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