Spaces:
Sleeping
Sleeping
create main.py
Browse files
main.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
# def greet(name):
|
4 |
+
# return "Hello " + name + "!!"
|
5 |
+
# import requests
|
6 |
+
|
7 |
+
API_URL = "https://api-inference.huggingface.co/models/AK-12/llama-2-medical-fine-tune"
|
8 |
+
headers = {"Authorization": "Bearer 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"}
|
9 |
+
|
10 |
+
def query(payload):
|
11 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
12 |
+
return response.json()
|
13 |
+
|
14 |
+
# output = query({
|
15 |
+
# "inputs": "What is haller cells? ",
|
16 |
+
# })
|
17 |
+
|
18 |
+
iface = gr.Interface(fn=query, inputs="text", outputs="text")
|
19 |
+
iface.launch()
|