Update app.py
Browse files
app.py
CHANGED
@@ -126,8 +126,12 @@ def query_model(question):
|
|
126 |
|
127 |
link_int=random.randint(0,6)
|
128 |
links=["https://chatgpt.com/","https://www.grammarly.com/","https://www.any.do/","https://scheduler.ai/","https://huggingface.co/spaces/MukBot/MukBot","https://huggingface.co/spaces/CalmConnect/calm-connect","https://chatgpt.com/g/g-3DGi2iLag-scholargpt","https://chatgpt.com/g/g-E7eSRUHy6-travel-guide"]
|
129 |
-
def
|
130 |
-
return
|
|
|
|
|
|
|
|
|
131 |
|
132 |
# Define the welcome message and specific topics the chatbot can provide information about
|
133 |
welcome_message = """
|
@@ -204,7 +208,7 @@ with gr.Blocks(theme=theme) as demo:
|
|
204 |
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)
|
205 |
submit_button.click(fn=query_model, inputs=question, outputs=answer)
|
206 |
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)
|
207 |
-
portal_button.click(fn=
|
208 |
|
209 |
#def display_response(question):
|
210 |
#response, confidence_score = query_model(question)
|
|
|
126 |
|
127 |
link_int=random.randint(0,6)
|
128 |
links=["https://chatgpt.com/","https://www.grammarly.com/","https://www.any.do/","https://scheduler.ai/","https://huggingface.co/spaces/MukBot/MukBot","https://huggingface.co/spaces/CalmConnect/calm-connect","https://chatgpt.com/g/g-3DGi2iLag-scholargpt","https://chatgpt.com/g/g-E7eSRUHy6-travel-guide"]
|
129 |
+
def get_random_link():
|
130 |
+
return random.choice(links)
|
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 = """
|
|
|
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)
|