Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -103,7 +103,7 @@ from safetensors.torch import load_file
|
|
103 |
|
104 |
class ModelInput(BaseModel):
|
105 |
prompt: str
|
106 |
-
max_new_tokens: int =
|
107 |
|
108 |
app = FastAPI()
|
109 |
|
@@ -144,7 +144,7 @@ except Exception as e:
|
|
144 |
print(f"Error during model loading: {e}")
|
145 |
raise
|
146 |
|
147 |
-
def generate_response(model, tokenizer, instruction, max_new_tokens=
|
148 |
"""Generate a response from the model based on an instruction."""
|
149 |
try:
|
150 |
# Format input for the model
|
|
|
103 |
|
104 |
class ModelInput(BaseModel):
|
105 |
prompt: str
|
106 |
+
max_new_tokens: int = 2048
|
107 |
|
108 |
app = FastAPI()
|
109 |
|
|
|
144 |
print(f"Error during model loading: {e}")
|
145 |
raise
|
146 |
|
147 |
+
def generate_response(model, tokenizer, instruction, max_new_tokens=2048):
|
148 |
"""Generate a response from the model based on an instruction."""
|
149 |
try:
|
150 |
# Format input for the model
|