Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,23 @@
|
|
|
|
1 |
import gradio as gr
|
|
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
2 |
import gradio as gr
|
3 |
+
import requests
|
4 |
+
import os
|
5 |
|
6 |
+
API_URL = "https://api-inference.huggingface.co/models/voxta/ehartford_dolphin-2_2-yi-34b-3bpw-exl2"
|
7 |
+
|
8 |
+
def query(payload):
|
9 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
10 |
+
return response.json()
|
11 |
+
|
12 |
+
def query_wrapper(text):
|
13 |
+
payload = {"inputs": text}
|
14 |
+
output = query(payload)
|
15 |
+
return output
|
16 |
+
|
17 |
+
iface = gr.Interface(
|
18 |
+
fn=query_wrapper,
|
19 |
+
inputs="text",
|
20 |
+
outputs="json"
|
21 |
+
)
|
22 |
+
|
23 |
+
iface.launch()
|