Ubik80's picture
Update app.py
dda44d0 verified
raw
history blame
473 Bytes
import os
os.environ["myToken"] = os.getenv("myToken")
import gradio as gr
from smolagents import CodeAgent, HfApiModel
from retriever import guest_info_tool
# Setup agent
model = HfApiModel()
alfred = CodeAgent(tools=[guest_info_tool], model=model)
# Gradio interface function
def ask_alfred(question):
return alfred.run(question)
# Gradio app
demo = gr.Interface(fn=ask_alfred, inputs="text", outputs="text", title="🎩 Alfred, Gala Assistant")
demo.launch()