Skip to content

Commit

Permalink
Added Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
sopheck committed Nov 28, 2023
1 parent 2acd488 commit 33cf1f0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM python:3.10

RUN mkdir /app
WORKDIR /app

ADD ./app/app.py .
ADD .env .
ADD requirements.txt .

RUN pip install --upgrade pip --no-cache-dir -r requirements.txt

EXPOSE 7860

CMD [ "python3", "app.py"]
7 changes: 7 additions & 0 deletions README.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# KI-Playground

## Docker Image

```bash
docker run --rm -it -p 7860:7860 -e GRADIO_SERVER_NAME=0.0.0.0
```
4 changes: 2 additions & 2 deletions app/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import gradio as gr
import openai

openai.api_key = "sk-..." # Replace with your key
openai.api_key = "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" # Replace with your key

def predict(message, history):
history_openai_format = []
Expand All @@ -23,4 +23,4 @@ def predict(message, history):
partial_message = partial_message + chunk['choices'][0]['delta']['content']
yield partial_message

gr.ChatInterface(predict).queue().launch()
gr.ChatInterface(predict).queue().launch(root_path="/ki-playground/gpt-3-5-turbo")
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
openai==0.28
gradio==4.7.1

0 comments on commit 33cf1f0

Please sign in to comment.