Spaces:
Sleeping
Sleeping
Update app.py
#2
by
habi01
- opened
app.py
CHANGED
|
@@ -2,7 +2,12 @@ from transformers import pipeline
|
|
| 2 |
import gradio as gr # Import Gradio for UI
|
| 3 |
|
| 4 |
# Load a text-generation model
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Load the classification model
|
| 8 |
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|
|
|
|
| 2 |
import gradio as gr # Import Gradio for UI
|
| 3 |
|
| 4 |
# Load a text-generation model
|
| 5 |
+
# Load a text-generation model
|
| 6 |
+
chatbot = pipeline("text-generation", model="habi01/teachbuddy_DialoV2",
|
| 7 |
+
temperature=0.65, # Slightly lower for consistency
|
| 8 |
+
top_p=0.85, # Reduce repetition
|
| 9 |
+
repetition_penalty=1.3, # Punish redundant phrases
|
| 10 |
+
max_length=100) # Allow longer responses if needed
|
| 11 |
|
| 12 |
# Load the classification model
|
| 13 |
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|