sophcheng commited on
Commit
85a769d
·
verified ·
1 Parent(s): a05cb99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -4
app.py CHANGED
@@ -131,8 +131,9 @@ def get_random_link():
131
 
132
  def create_random_link():
133
  random_link = get_random_link()
134
- return f'<a href="{random_link}" target="_blank">I Feel Tech-y!</a>'
135
-
 
136
  # Define the welcome message and specific topics the chatbot can provide information about
137
  welcome_message = """
138
  ## Albot AI-nstein is your AI-driven assistant, for all things AI.
@@ -207,8 +208,12 @@ with gr.Blocks(theme=theme) as demo:
207
  submit_button = gr.Button("Submit!")
208
  answer = gr.Textbox(label="AI-nswer:", placeholder="Hello, World! \nAsk me anything about AI ML, and helpful tools you may want to use!", interactive=False, lines=10)
209
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
210
- portal_button = gr.Image("einy.png", container = False, show_share_button = False, show_download_button = False, label="output", show_label=True, elem_id="output_image", scale=0, width=500)
211
- portal_button.click(fn=create_random_link, inputs=[], outputs="html")
 
 
 
 
212
 
213
  #def display_response(question):
214
  #response, confidence_score = query_model(question)
 
131
 
132
  def create_random_link():
133
  random_link = get_random_link()
134
+ return f'<a href="{random_link}" target="_blank"><img src = "einy.png" style="width:500px;"></a>'
135
+ #return f'<a href="{random_link}" target="_blank">I Feel Tech-y!</a>'
136
+
137
  # Define the welcome message and specific topics the chatbot can provide information about
138
  welcome_message = """
139
  ## Albot AI-nstein is your AI-driven assistant, for all things AI.
 
208
  submit_button = gr.Button("Submit!")
209
  answer = gr.Textbox(label="AI-nswer:", placeholder="Hello, World! \nAsk me anything about AI ML, and helpful tools you may want to use!", interactive=False, lines=10)
210
  submit_button.click(fn=query_model, inputs=question, outputs=answer)
211
+
212
+ interface = gr.Interface(fn=create_random_link_button, inputs=[], outputs="html")
213
+ interface.launch()
214
+
215
+ #portal_button = gr.Image("einy.png", container = False, show_share_button = False, show_download_button = False, label="output", show_label=True, elem_id="output_image", scale=0, width=500)
216
+ #portal_button.click(fn=create_random_link, inputs=[], outputs="html")
217
 
218
  #def display_response(question):
219
  #response, confidence_score = query_model(question)