Spaces:
Sleeping
Sleeping
Commit History
-
fix: use correct Groq model ID 'openai/gpt-oss-120b'β
The model ID 'gpt-oss-120b' (without prefix) 404s on Groq's API. The docs list the ID as 'openai/gpt-oss-120b' β use the full ID. llama-3.3-70b-versatile is Enterprise-tier and inaccessible on the Developer plan; openai/gpt-oss-120b is pay-as-you-go.67377e5 -
fix: Gradio 6.x Chatbot message format (dicts not tuples)β
Gradio 6.x Chatbot expects messages as {'role': ..., 'content': ...} dicts, not the (user, bot) tuples from Gradio 5.x. Without this, the postprocess step raises: Data incompatible with messages format. Also guard against history=None for the initial empty Chatbot.1844609 -
fix: switch default Groq model to gpt-oss-120b (free tier), add graceful API error handlingβ
- llama-3.3-70b-versatile is Enterprise-tier on Groq and 404s on the Developer plan β switch default to gpt-oss-120b (pay-as-you-go, 120B) - Wrap llm.invoke in try/except so API failures show a user-friendly message in the Gradio UI instead of crashing with a tracebacke0ce81f -
fix: move @spaces.GPU to minimal init_gpu() to avoid PicklingErrorβ
The @spaces.GPU decorator on load_chain_components caused PicklingError because ZeroGPU runs decorated functions in a worker process, and the return value (FAISS vectorstore + ChatGroq) can't be pickled across process boundaries (contains threading.RLock). Fix: - Remove @GPU_DECORATOR from load_chain_components (runs in main process) - Add trivial init_gpu() @spaces.GPU function (returns bool, picklable) - Force HuggingFaceEmbeddings to CPU (90MB model, GPU not needed) - Call init_gpu() at startup in app.py before load_chain_components()66c0dce -
Merge remote-tracking branch 'origin/main'
7c23d45 -
fix: add @spaces.GPU decorator to load_chain_components for ZeroGPUβ
The HF Spaces runtime emits 'No @spaces.GPU function detected during startup' when no function is decorated with @spaces.GPU, and may tear down the SSR/Node proxy as a result. Fix: - Decorate load_chain_components (the function that instantiates the torch-based HuggingFaceEmbeddings model) with @spaces.GPU - Move import spaces to the very top of rag_chain.py, before the langchain_huggingface β sentence-transformers β torch import chain (preserves the CUDA init order fix from the previous commit) - Keep import spaces in app.py as belt-and-suspenders safety762eed0 -
Update app.py
Verified signature833a52a -
Fix CUDA/spaces import order: import spaces before torch in app.pyβ
The HF Spaces runtime raised: RuntimeError: CUDA has been initialized before importing the spaces package. gradio's background watcher thread lazily imports spaces, but by then torch (via langchain_huggingface β sentence-transformers β transformers β torch) had already initialized CUDA. Fix: import spaces at the very top of app.py, before any import chain that touches torch. try/except keeps it working locally where the spaces package isn't installed.f8b39f5 -
Fix HF Spaces build: upgrade sentence-transformers to >=5.2.0 for transformers 5.x / huggingface-hub 1.x compatibility with gradio 6.26.0β
- Remove gradio pin (base image provides gradio==6.26.0) - Upgrade sentence-transformers from 3.2.1 to >=5.2.0 (3.2.1 forced transformers<5.0.0, whose huggingface-hub<1.0 conflicts with gradio's huggingface-hub>=1.16.0) - Pin transformers>=5.0.0,<6.0 (5.0.0 lifted the huggingface-hub upper bound to <2.0, resolving the conflict) - Add langchain-huggingface>=0.1.2,<1.0 (compatible with langchain 0.3.x) - Migrate embeddings imports from langchain_community to langchain_huggingface - Add git-lfs tracking for PDFs and FAISS index artifactsfe898d6