AK-12 commited on
Commit
c8c2702
1 Parent(s): 3cf5236

create main.py

Browse files
Files changed (1) hide show
  1. main.py +19 -0
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()