Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ try:
|
|
24 |
import psutil
|
25 |
import resource
|
26 |
total_memory = psutil.virtual_memory().total
|
27 |
-
limit = int(total_memory *
|
28 |
resource.setrlimit(resource.RLIMIT_AS, (limit, limit))
|
29 |
# print(f"Memory limit set to {limit} bytes (1% of total system memory).")
|
30 |
except Exception as e:
|
@@ -169,7 +169,6 @@ async def stream_text(model, tokenizer, input_text, generation_config, stopping_
|
|
169 |
**encoded_input,
|
170 |
generation_config=generation_config,
|
171 |
stopping_criteria=stopping_criteria_list,
|
172 |
-
stream=True,
|
173 |
return_dict_in_generate=True,
|
174 |
output_scores=True,
|
175 |
):
|
@@ -257,4 +256,4 @@ async def generate_video(request: GenerateRequest):
|
|
257 |
raise HTTPException(status_code=500, detail=f"Internal server error: {str(e)}")
|
258 |
|
259 |
if __name__ == "__main__":
|
260 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
24 |
import psutil
|
25 |
import resource
|
26 |
total_memory = psutil.virtual_memory().total
|
27 |
+
limit = int(total_memory * 0.01) # 1% del total en bytes
|
28 |
resource.setrlimit(resource.RLIMIT_AS, (limit, limit))
|
29 |
# print(f"Memory limit set to {limit} bytes (1% of total system memory).")
|
30 |
except Exception as e:
|
|
|
169 |
**encoded_input,
|
170 |
generation_config=generation_config,
|
171 |
stopping_criteria=stopping_criteria_list,
|
|
|
172 |
return_dict_in_generate=True,
|
173 |
output_scores=True,
|
174 |
):
|
|
|
256 |
raise HTTPException(status_code=500, detail=f"Internal server error: {str(e)}")
|
257 |
|
258 |
if __name__ == "__main__":
|
259 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|