Spaces:
Sleeping
Sleeping
雷娃
commited on
Commit
·
06a57b1
1
Parent(s):
fd5c246
add install.sh
Browse files
app.py
CHANGED
|
@@ -76,11 +76,15 @@ def respond(
|
|
| 76 |
|
| 77 |
model_inputs = tokenizer([text], return_tensors="pt", return_token_type_ids=False).to(model.device)
|
| 78 |
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
| 82 |
presence_penalty = 1.5,
|
| 83 |
-
|
|
|
|
| 84 |
|
| 85 |
# Start a separate thread for model generation to allow streaming output
|
| 86 |
thread = Thread(
|
|
|
|
| 76 |
|
| 77 |
model_inputs = tokenizer([text], return_tensors="pt", return_token_type_ids=False).to(model.device)
|
| 78 |
|
| 79 |
+
print(f"max_new_tokens={max_tokens}, temperature={temperature}, top_p={top_p}")
|
| 80 |
+
model_inputs.update(
|
| 81 |
+
dict(max_new_tokens=max_tokens,
|
| 82 |
+
streamer = streamer,
|
| 83 |
+
temperature = float(temperature),
|
| 84 |
+
top_p = float(top_p),
|
| 85 |
presence_penalty = 1.5,
|
| 86 |
+
)
|
| 87 |
+
)
|
| 88 |
|
| 89 |
# Start a separate thread for model generation to allow streaming output
|
| 90 |
thread = Thread(
|