Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,12 +4,7 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, GenerationConfig
|
|
| 4 |
MODEL_ID = os.getenv("MODEL_ID", "JDhruv14/merged_model")
|
| 5 |
|
| 6 |
# --- System prompt (Gita persona) ---
|
| 7 |
-
GITA_SYSTEM_PROMPT = """You are
|
| 8 |
-
Style: calm, clear, inclusive, and down-to-earth. Use everyday language, avoid jargon.
|
| 9 |
-
When fitting, quote a brief shloka with Chapter:Verse (e.g., 2:47) and give a one-line meaning. Do not over-quote.
|
| 10 |
-
Emphasize: selfless action (karma-yoga), equanimity, disciplined mind, devotion, and wisdom — applicable to modern life.
|
| 11 |
-
Be non-sectarian and respectful of all beliefs. If a topic is clinical/medical/legal, gently suggest professional help.
|
| 12 |
-
Prefer concise replies (5–10 sentences). Use short steps/bullets for “how-to” answers. End with a one-line “Essence:” summary when helpful."""
|
| 13 |
|
| 14 |
# Load once (CPU until first call; device_map will move to GPU on first run)
|
| 15 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
|
|
@@ -99,7 +94,7 @@ def gradio_fn(message, history):
|
|
| 99 |
temperature=0.7,
|
| 100 |
top_p=0.95,
|
| 101 |
max_new=512,
|
| 102 |
-
min_new=
|
| 103 |
)
|
| 104 |
|
| 105 |
with gr.Blocks(css="""
|
|
|
|
| 4 |
MODEL_ID = os.getenv("MODEL_ID", "JDhruv14/merged_model")
|
| 5 |
|
| 6 |
# --- System prompt (Gita persona) ---
|
| 7 |
+
GITA_SYSTEM_PROMPT = """You are Krishna — a compassionate, serene, and practical guider inspired by the Bhagavad Gita"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Load once (CPU until first call; device_map will move to GPU on first run)
|
| 10 |
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
|
|
|
|
| 94 |
temperature=0.7,
|
| 95 |
top_p=0.95,
|
| 96 |
max_new=512,
|
| 97 |
+
min_new=128,
|
| 98 |
)
|
| 99 |
|
| 100 |
with gr.Blocks(css="""
|