Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
|
2 |
-
from flask import Flask, request, Response
|
3 |
import os
|
4 |
from rich import print
|
5 |
import json
|
@@ -36,8 +36,8 @@ def send():
|
|
36 |
|
37 |
client = Client("https://ysharma-explore-llamav2-with-tgi.hf.space/")
|
38 |
result = client.predict(message, api_name="/chat")
|
39 |
-
|
40 |
-
return
|
41 |
|
42 |
@app.route("/chat/completions", methods=['POST'])
|
43 |
def chat_completions():
|
|
|
1 |
|
2 |
+
from flask import Flask, request, Response, jsonify
|
3 |
import os
|
4 |
from rich import print
|
5 |
import json
|
|
|
36 |
|
37 |
client = Client("https://ysharma-explore-llamav2-with-tgi.hf.space/")
|
38 |
result = client.predict(message, api_name="/chat")
|
39 |
+
response = {'response': result}
|
40 |
+
return jsonify(response)
|
41 |
|
42 |
@app.route("/chat/completions", methods=['POST'])
|
43 |
def chat_completions():
|