Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import requests
|
| 3 |
+
|
| 4 |
+
def generate_response(user_input):
|
| 5 |
+
response = requests.post(url="https://llm01.mosaik.io/chat",headers={'secret-key': 'ABCDEF'},json={"uid":123,"message":user_input,"stream":False})
|
| 6 |
+
return response.content
|
| 7 |
+
|
| 8 |
+
iface = gr.Interface(
|
| 9 |
+
fn=generate_response,
|
| 10 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter your text here..."),
|
| 11 |
+
outputs=gr.Textbox()
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
iface.launch()
|