Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,14 +4,14 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStream
|
|
4 |
import torch
|
5 |
from threading import Thread
|
6 |
|
7 |
-
phi4_model_path = "
|
8 |
|
9 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
10 |
|
11 |
phi4_model = AutoModelForCausalLM.from_pretrained(phi4_model_path, device_map="auto", torch_dtype="auto")
|
12 |
phi4_tokenizer = AutoTokenizer.from_pretrained(phi4_model_path)
|
13 |
|
14 |
-
@spaces.GPU(duration=
|
15 |
def generate_response(user_message, max_tokens, temperature, top_k, top_p, repetition_penalty, history_state):
|
16 |
if not user_message.strip():
|
17 |
return history_state, history_state
|
|
|
4 |
import torch
|
5 |
from threading import Thread
|
6 |
|
7 |
+
phi4_model_path = "microsoft/Phi-4-reasoning-plus"
|
8 |
|
9 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
10 |
|
11 |
phi4_model = AutoModelForCausalLM.from_pretrained(phi4_model_path, device_map="auto", torch_dtype="auto")
|
12 |
phi4_tokenizer = AutoTokenizer.from_pretrained(phi4_model_path)
|
13 |
|
14 |
+
@spaces.GPU(duration=120)
|
15 |
def generate_response(user_message, max_tokens, temperature, top_k, top_p, repetition_penalty, history_state):
|
16 |
if not user_message.strip():
|
17 |
return history_state, history_state
|