Spaces:
Sleeping
Sleeping
Commit
ยท
d29211b
1
Parent(s):
f6a2a35
add
Browse files
app.py
CHANGED
@@ -10,7 +10,9 @@ def load_model(model_name="deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"):
|
|
10 |
model=model_name,
|
11 |
device_map="auto",
|
12 |
torch_dtype=torch.float16,
|
13 |
-
trust_remote_code=True
|
|
|
|
|
14 |
)
|
15 |
return pipe
|
16 |
|
@@ -53,7 +55,14 @@ def main():
|
|
53 |
prompt = f"Human: {user_input}\n\nAssistant:"
|
54 |
|
55 |
# ๋ชจ๋ธ ์์ฑ
|
56 |
-
response = pipe(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
bot_text = response[0]["generated_text"]
|
58 |
|
59 |
# Assistant ์๋ต๋ง ์ถ์ถ
|
|
|
10 |
model=model_name,
|
11 |
device_map="auto",
|
12 |
torch_dtype=torch.float16,
|
13 |
+
trust_remote_code=True,
|
14 |
+
truncation=True,
|
15 |
+
max_new_tokens=512
|
16 |
)
|
17 |
return pipe
|
18 |
|
|
|
55 |
prompt = f"Human: {user_input}\n\nAssistant:"
|
56 |
|
57 |
# ๋ชจ๋ธ ์์ฑ
|
58 |
+
response = pipe(
|
59 |
+
prompt,
|
60 |
+
max_length=2048,
|
61 |
+
temperature=0.7,
|
62 |
+
do_sample=True,
|
63 |
+
truncation=True,
|
64 |
+
max_new_tokens=512
|
65 |
+
)
|
66 |
bot_text = response[0]["generated_text"]
|
67 |
|
68 |
# Assistant ์๋ต๋ง ์ถ์ถ
|