BICORP commited on
Commit
8e686f0
·
verified ·
1 Parent(s): e78a8d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -2,9 +2,9 @@ import gradio as gr
2
  from transformers import pipeline
3
  import requests
4
 
5
- # Use a model that supports conversational tasks
6
- standard_model = pipeline("conversational", model="google/mt5-base")
7
- premium_model = pipeline("conversational", model="google/mt5-base")
8
 
9
  # Your Boosty API key or any method of checking subscriptions
10
  BOOSTY_API_KEY = "YOUR_BOOSTY_API_KEY"
@@ -30,7 +30,7 @@ def chat_with_ai(user_input, boosty_user_id):
30
 
31
  # Get AI response
32
  conversation = model_to_use(user_input)
33
- return conversation[-1]["generated_text"]
34
 
35
  # Create the Gradio interface
36
  iface = gr.Interface(
 
2
  from transformers import pipeline
3
  import requests
4
 
5
+ # Use the text-generation task
6
+ standard_model = pipeline("text-generation", model="google/mt5-base")
7
+ premium_model = pipeline("text-generation", model="google/mt5-base")
8
 
9
  # Your Boosty API key or any method of checking subscriptions
10
  BOOSTY_API_KEY = "YOUR_BOOSTY_API_KEY"
 
30
 
31
  # Get AI response
32
  conversation = model_to_use(user_input)
33
+ return conversation[0]["generated_text"]
34
 
35
  # Create the Gradio interface
36
  iface = gr.Interface(