yxmauw commited on
Commit
0636dcf
1 Parent(s): 0f0d211

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -8
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.Gallery(label="Current Space Hardware used",
42
- value=["space_hardware.png"],
43
- type="filepath",
44
- columns=1,
45
- object_fit="scale-down",
46
- height=100,
47
- container=False
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")