rahul7star commited on
Commit
e6cd92e
·
verified ·
1 Parent(s): 828cc2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import gradio as gr
2
- from fastai.text.all import load_learner, TextBlock, CategoryBlock
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(fn=predict, inputs="text", outputs="text").launch()
 
 
 
 
 
 
 
 
 
 
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()