Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,13 @@ from urllib.request import urlopen
|
|
4 |
import json
|
5 |
import time
|
6 |
from load_llms import model_choices, llm_intro, load_model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
|
8 |
|
9 |
# Construct chatbot
|
@@ -38,14 +45,16 @@ with gr.Blocks(
|
|
38 |
# Link the dropdown with the textbox to update the description based on the selected model
|
39 |
model_dropdown.change(fn=llm_intro, inputs=model_dropdown, outputs=explanation)
|
40 |
|
41 |
-
gr.
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
|
|
|
|
49 |
|
50 |
with gr.Column(scale=4, elem_id='col'):
|
51 |
chatbot = gr.Chatbot(label="Chatroom", value=[(None, "How may I help you today?")], elem_id="chatbot")
|
|
|
4 |
import json
|
5 |
import time
|
6 |
from load_llms import model_choices, llm_intro, load_model
|
7 |
+
from huggingface_hub import HfApi
|
8 |
+
|
9 |
+
|
10 |
+
repo_id = "yxmauw/chatbot"
|
11 |
+
api = HfApi()
|
12 |
+
runtime = api.get_space_runtime(repo_id=repo_id)
|
13 |
+
|
14 |
|
15 |
|
16 |
# Construct chatbot
|
|
|
45 |
# Link the dropdown with the textbox to update the description based on the selected model
|
46 |
model_dropdown.change(fn=llm_intro, inputs=model_dropdown, outputs=explanation)
|
47 |
|
48 |
+
gr.Markdown(f"## Running on {runtime.hardware}")
|
49 |
+
|
50 |
+
# gr.Gallery(label="Current Space Hardware used",
|
51 |
+
# value=["space_hardware.png"],
|
52 |
+
# type="filepath",
|
53 |
+
# columns=1,
|
54 |
+
# object_fit="scale-down",
|
55 |
+
# height=100,
|
56 |
+
# container=False
|
57 |
+
# )
|
58 |
|
59 |
with gr.Column(scale=4, elem_id='col'):
|
60 |
chatbot = gr.Chatbot(label="Chatroom", value=[(None, "How may I help you today?")], elem_id="chatbot")
|