Update app.py
Browse files
app.py
CHANGED
|
@@ -67,11 +67,11 @@ demo = gr.ChatInterface(
|
|
| 67 |
|
| 68 |
app = FastAPI()
|
| 69 |
|
| 70 |
-
@app.head("/
|
| 71 |
def chat_head():
|
| 72 |
return StreamingResponse("", media_type="application/json")
|
| 73 |
|
| 74 |
-
@app.get("/
|
| 75 |
def chat_get(message: str = "", system_message: str = "You are a friendly Chatbot.", max_tokens: int = 512, temperature: float = 0.7, top_p: float = 0.95):
|
| 76 |
predict_response = requests.post('http://localhost:7860/call/chat', json={'data': [message, [], system_message, max_tokens, temperature, top_p]}).json()
|
| 77 |
if "event_id" not in predict_response:
|
|
|
|
| 67 |
|
| 68 |
app = FastAPI()
|
| 69 |
|
| 70 |
+
@app.head("/ask")
|
| 71 |
def chat_head():
|
| 72 |
return StreamingResponse("", media_type="application/json")
|
| 73 |
|
| 74 |
+
@app.get("/ask")
|
| 75 |
def chat_get(message: str = "", system_message: str = "You are a friendly Chatbot.", max_tokens: int = 512, temperature: float = 0.7, top_p: float = 0.95):
|
| 76 |
predict_response = requests.post('http://localhost:7860/call/chat', json={'data': [message, [], system_message, max_tokens, temperature, top_p]}).json()
|
| 77 |
if "event_id" not in predict_response:
|