Spaces:
Runtime error
Runtime error
Initial Commit
Browse files- app.py +19 -1
- requirements.txt +2 -1
app.py
CHANGED
@@ -1,7 +1,25 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def greet(name):
|
4 |
return "Hello " + name + "!!"
|
5 |
|
6 |
-
iface = gr.Interface(fn=
|
7 |
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
+
|
4 |
+
|
5 |
+
model = "meta-llama/Llama-2-13b-chat-hf"
|
6 |
+
|
7 |
+
API_URL = os.environ.get("API_URL")
|
8 |
+
BEARER_TOKEN = os.environ.get("BEARER_TOKEN")
|
9 |
+
import requests
|
10 |
+
|
11 |
+
headers = {"Authorization": BEARER_TOKEN }
|
12 |
+
|
13 |
+
def query(payload):
|
14 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
15 |
+
return response.json()
|
16 |
+
|
17 |
+
# output = query({
|
18 |
+
# "inputs": "Can you please let us know more details about your ",
|
19 |
+
# })
|
20 |
|
21 |
def greet(name):
|
22 |
return "Hello " + name + "!!"
|
23 |
|
24 |
+
iface = gr.Interface(fn=query, inputs="text", outputs="text")
|
25 |
iface.launch()
|
requirements.txt
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
gradio
|
|
|
|
1 |
+
gradio
|
2 |
+
requests
|