Skip to content

Commit

Permalink
Use gradio blocks for hot reloading
Browse files Browse the repository at this point in the history
Run with `gradio marvin_bot.py`
  • Loading branch information
fhinkel committed Feb 17, 2025
1 parent 8f76350 commit 547445b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions marvin_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
client = genai.Client(api_key=os.getenv("GEMINI_API_KEY"))

chat = client.chats.create(model="tunedModels/sarcastic-g1851wnu1i60")
# model="gemini-2.0-flash-001",
# model="gemini-2.0-flash-001",


def echo(message, history):
response = chat.send_message(message)
Expand All @@ -24,14 +25,16 @@ def echo(message, history):
return response.text


iface = gr.ChatInterface(
ci = gr.ChatInterface(
fn=echo,
textbox=gr.Textbox(placeholder="Type your message here..."),
title="Marvin the Paranoid Android",
type="messages"
type="messages",
textbox=gr.Textbox(placeholder="Type your message here..."),
)

iface.launch()
with gr.Blocks() as demo:
ci.render()

# echo("what color are oranges?", None)
demo.launch()

# echo("what color are oranges?", None)

0 comments on commit 547445b

Please sign in to comment.