Spaces:
Running
Running
yuto0o
commited on
Commit
·
dd95ee1
1
Parent(s):
a8fd17e
性能検査
Browse files- ml_api/api.py +1 -1
- ml_api/model_loader.py +1 -1
ml_api/api.py
CHANGED
|
@@ -38,7 +38,7 @@ def chat(request, data: ChatInput):
|
|
| 38 |
with torch.no_grad():
|
| 39 |
generated_ids = model.generate(
|
| 40 |
**inputs,
|
| 41 |
-
max_new_tokens=
|
| 42 |
do_sample=True,
|
| 43 |
temperature=0.7,
|
| 44 |
top_p=0.9,
|
|
|
|
| 38 |
with torch.no_grad():
|
| 39 |
generated_ids = model.generate(
|
| 40 |
**inputs,
|
| 41 |
+
max_new_tokens=1024,
|
| 42 |
do_sample=True,
|
| 43 |
temperature=0.7,
|
| 44 |
top_p=0.9,
|
ml_api/model_loader.py
CHANGED
|
@@ -28,7 +28,7 @@ def get_model():
|
|
| 28 |
|
| 29 |
_model = AutoModelForCausalLM.from_pretrained(
|
| 30 |
model_name,
|
| 31 |
-
|
| 32 |
trust_remote_code=True,
|
| 33 |
)
|
| 34 |
print(f"Model Loaded! (dtype: {dtype})")
|
|
|
|
| 28 |
|
| 29 |
_model = AutoModelForCausalLM.from_pretrained(
|
| 30 |
model_name,
|
| 31 |
+
dtype=dtype,
|
| 32 |
trust_remote_code=True,
|
| 33 |
)
|
| 34 |
print(f"Model Loaded! (dtype: {dtype})")
|