Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,12 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
import spaces
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 5 |
|
| 6 |
# Load model and tokenizer
|
|
@@ -90,6 +96,8 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 90 |
|
| 91 |
- **Enable Reasoning**: Activates the model's chain-of-thought reasoning (/think mode)
|
| 92 |
- **Disable Reasoning**: Uses direct response generation (/no_think mode)
|
|
|
|
|
|
|
| 93 |
"""
|
| 94 |
)
|
| 95 |
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
import spaces
|
| 4 |
+
import subprocess
|
| 5 |
+
import sys
|
| 6 |
+
|
| 7 |
+
# Install specific transformers version
|
| 8 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "transformers==4.48.3"])
|
| 9 |
+
|
| 10 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 11 |
|
| 12 |
# Load model and tokenizer
|
|
|
|
| 96 |
|
| 97 |
- **Enable Reasoning**: Activates the model's chain-of-thought reasoning (/think mode)
|
| 98 |
- **Disable Reasoning**: Uses direct response generation (/no_think mode)
|
| 99 |
+
|
| 100 |
+
**Note:** Using transformers version 4.48.3 as recommended by the model documentation.
|
| 101 |
"""
|
| 102 |
)
|
| 103 |
|