Spaces:
Runtime error
Runtime error
Update app.py
Browse files33 unmodified lines3435363738394050 unmodified lines919293949596976 unmodified lines10410510610710810911033 unmodified linesst.session_state.follow_up = ""# β Initialize Hugging Face Model (Explicitly Set to CPU/GPU)def get_llm_hf_inference(model_id="meta-llama/Llama-2-7b-chat-hf", max_new_tokens=512, temperature=0.7):#mistralai/Mistral-7B-Instruct-v0.3return HuggingFaceEndpoint(repo_id=model_id,50 unmodified lines"Ensure it's concise and structured exactly as requested without extra commentary.")hf = get_llm_hf_inference(max_new_tokens=30, temperature=0.6) # π₯ Lower temp for consistencyoutput = hf.invoke(input=prompt_text).strip()# β Extract the relevant part using regex to remove unwanted symbols or truncations6 unmodified linesreturn cleaned_output# β Main Response Functiondef get_response(system_message, chat_history, user_text, max_new_tokens=512):action = predict_action(user_text)# β Handle NASA-Specific Queries33 unmodified lines3435363738394050 unmodified lines919293949596976 unmodified lines10410510610710810911033 unmodified linesst.session_state.follow_up = ""# β Initialize Hugging Face Model (Explicitly Set to CPU/GPU)def get_llm_hf_inference(model_id="meta-llama/Llama-2-7b-chat-hf", max_new_tokens=800, temperature=0.8):#mistralai/Mistral-7B-Instruct-v0.3return HuggingFaceEndpoint(repo_id=model_id,50 unmodified lines"Ensure it's concise and structured exactly as requested without extra commentary.")hf = get_llm_hf_inference(max_new_tokens=30, temperature=0.8) # π₯ Lower temp for consistencyoutput = hf.invoke(input=prompt_text).strip()# β Extract the relevant part using regex to remove unwanted symbols or truncations6 unmodified linesreturn cleaned_output# β Main Response Functiondef get_response(system_message, chat_history, user_text, max_new_tokens=800):action = predict_action(user_text)# β Handle NASA-Specific Queries
app.py+3-3