Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
from fastai.text.all import load_learner
|
3 |
from huggingface_hub import hf_hub_download
|
4 |
|
5 |
# Step 1: Redefine Custom Functions
|
@@ -39,5 +39,14 @@ def predict(input_text):
|
|
39 |
except Exception as e:
|
40 |
return f"Error during prediction: {e}"
|
41 |
|
42 |
-
# Step 4: Create Gradio Interface
|
43 |
-
gr.Interface(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from fastai.text.all import load_learner
|
3 |
from huggingface_hub import hf_hub_download
|
4 |
|
5 |
# Step 1: Redefine Custom Functions
|
|
|
39 |
except Exception as e:
|
40 |
return f"Error during prediction: {e}"
|
41 |
|
42 |
+
# Step 4: Create Gradio Interface with Examples
|
43 |
+
gr.Interface(
|
44 |
+
fn=predict,
|
45 |
+
inputs="text",
|
46 |
+
outputs="text",
|
47 |
+
examples=[
|
48 |
+
["Who is rahul7star?"], # Example 1
|
49 |
+
["What does Rahul7star do?"], # Example 2
|
50 |
+
["Tell me about Rahul7star"] # Example 3
|
51 |
+
]
|
52 |
+
).launch()
|