Spaces:
Sleeping
Sleeping
Update llm_node.py
Browse files12345677 unmodified lines1516171819from langchain_community.chat_models import ChatOpenAIdef llm_node(question):llm = ChatOpenAI(model="gpt-3.5-turbo", temperature=0)prompt = f"""You are solving a GAIA benchmark evaluation question.⚠️ VERY IMPORTANT:7 unmodified lines{question}Your direct answer:"""response = llm.invoke(prompt)return response.content.strip()123456789101112131415167 unmodified lines242526272829303132from langchain_community.llms import HuggingFaceHubdef llm_node(question):# Initialize the Hugging Face modelllm = HuggingFaceHub(repo_id="HuggingFaceH4/zephyr-7b-beta", # You can replace with e.g., mistralai/Mistral-7B-Instruct-v0.2model_kwargs={"temperature": 0.1, # Keep responses deterministic"max_new_tokens": 500 # Allow for longer outputs if needed})# Craft the prompt carefully for exact-match outputsprompt = f"""You are solving a GAIA benchmark evaluation question.⚠️ VERY IMPORTANT:7 unmodified lines{question}Your direct answer:"""# Run the modelresponse = llm.invoke(prompt)# Clean up whitespace or stray charactersreturn response.strip()
llm_node.py+16-3