Skip to content

Commit

Permalink
Merge pull request #4 from Murithijoshua/main
Browse files Browse the repository at this point in the history
chatbot changes
  • Loading branch information
Murithijoshua authored Mar 4, 2024
2 parents 5588253 + fd06a88 commit 4033f88
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Push Docker Image to Docker Hub

on:
push:
branches: [ "dev", "main" ]
pull_request:
branches: [ "dev", "main" ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: docker.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build -t ushauri_api:latest .
test:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Test the Docker image
run: docker run -p 7002:5000 --name ushauri_api -d --restart always ushauri_api:latest
push_to_registry:
needs: build
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: "{{defaultContext}}"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

6 changes: 3 additions & 3 deletions routes/processes/nishauri_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import sys

# take passed variable values
question = sys.argv[1];
#question = 'am good';
# question = sys.argv[1];
question = 'How do i reschedule appointment?';
#token = sys.argv[2];


# calcluate the total using variable values and print the output
def chat_nishauri(question):
from gradio_client import Client;
client = Client("Nishauri/ChatBot", verbose=False);
client = Client("http://192.168.1.44:7861", verbose=False);
result = client.predict(
question, # str in 'question' Textbox component
api_name="/predict"
Expand Down

0 comments on commit 4033f88

Please sign in to comment.