Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,14 @@ import requests
|
|
| 4 |
OLLAMA_URL = "http://localhost:11434/api/generate"
|
| 5 |
|
| 6 |
def chat_fn(message, history):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
payload = {
|
| 8 |
"model": "mistral",
|
| 9 |
"prompt": message,
|
|
@@ -36,4 +44,9 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue")) as demo:
|
|
| 36 |
outputs=[chatbot, msg]
|
| 37 |
)
|
| 38 |
|
| 39 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
OLLAMA_URL = "http://localhost:11434/api/generate"
|
| 5 |
|
| 6 |
def chat_fn(message, history):
|
| 7 |
+
if history is None:
|
| 8 |
+
history = []
|
| 9 |
+
|
| 10 |
+
reply = f"Test cevap: {message}"
|
| 11 |
+
|
| 12 |
+
history.append((message, reply))
|
| 13 |
+
return history, ""
|
| 14 |
+
|
| 15 |
payload = {
|
| 16 |
"model": "mistral",
|
| 17 |
"prompt": message,
|
|
|
|
| 44 |
outputs=[chatbot, msg]
|
| 45 |
)
|
| 46 |
|
| 47 |
+
demo.launch(
|
| 48 |
+
server_name="0.0.0.0",
|
| 49 |
+
server_port=7860,
|
| 50 |
+
show_error=True
|
| 51 |
+
)
|
| 52 |
+
|