andreska commited on
Commit
5462aaf
·
verified ·
1 Parent(s): 6dec643

Update to use Gradio for endpoint call

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import os
 
2
  from huggingface_hub import InferenceClient
3
 
4
  def analyze_project(project_data, question):
@@ -14,4 +15,12 @@ def analyze_project(project_data, question):
14
  max_new_tokens=100
15
  )
16
 
17
- return outputs["generated_text"][0]
 
 
 
 
 
 
 
 
 
1
  import os
2
+ import gradio gr
3
  from huggingface_hub import InferenceClient
4
 
5
  def analyze_project(project_data, question):
 
15
  max_new_tokens=100
16
  )
17
 
18
+ return outputs["generated_text"][0]
19
+
20
+ iface = gr.Interface(
21
+ fn=analyze_project,
22
+ inputs=["text", "text"],
23
+ outputs="text"
24
+ )
25
+
26
+ iface.launch(share=True, api=True)