jatinsabari commited on
Commit
072a712
·
verified ·
1 Parent(s): d1efeed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
- # Load DistilBERT for text generation on CPU
5
- model = pipeline("text-generation", model="distilbert-base-uncased", device="cpu")
6
 
7
  # Define text generation function
8
  def generate_text(message, history):
@@ -15,9 +15,9 @@ def generate_text(message, history):
15
  # Gradio ChatInterface
16
  interface = gr.ChatInterface(
17
  fn=generate_text,
18
- title="DistilBERT Chatbot",
19
- description="Powered by DistilBERT on Hugging Face Spaces (CPU Basic). Use API or UI!",
20
- examples=["Hello, how are you?", "Tell me a short fact", "What’s 2+2?"]
21
  )
22
 
23
  # Launch with API endpoint
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
4
+ # Load distilgpt2 for text generation on CPU
5
+ model = pipeline("text-generation", model="distilgpt2", device="cpu")
6
 
7
  # Define text generation function
8
  def generate_text(message, history):
 
15
  # Gradio ChatInterface
16
  interface = gr.ChatInterface(
17
  fn=generate_text,
18
+ title="DistilGPT2 Chatbot",
19
+ description="Powered by DistilGPT2 on Hugging Face Spaces (CPU Basic). Use API or UI!",
20
+ examples=["Hello, how are you?", "Tell me a short joke", "What’s 2+2?"]
21
  )
22
 
23
  # Launch with API endpoint