Spaces:
Sleeping
Sleeping
Update app.py
Browse files123482 unmodified lines878889909192import os# Prevent CPU Threading Crashesos.environ["OMP_NUM_THREADS"] = "1"os.environ["TOKENIZERS_PARALLELISM"] = "false"82 unmodified linesapp_graph = workflow.compile()# 4. Define the Gradio Chat Functiondef predict(message, history):result = app_graph.invoke({"question": message})return result["generation"]12345682 unmodified lines8990919293949596import spaces # THIS MUST BE THE ABSOLUTE FIRST IMPORT IN ZERO-GPU SPACESimport os# Prevent CPU Threading Crashesos.environ["OMP_NUM_THREADS"] = "1"os.environ["TOKENIZERS_PARALLELISM"] = "false"82 unmodified linesapp_graph = workflow.compile()# 4. Define the Gradio Chat Function# The @spaces.GPU decorator tells Hugging Face to allocate the GPU during inference@spaces.GPUdef predict(message, history):result = app_graph.invoke({"question": message})return result["generation"]
app.py+4