yxmauw commited on
Commit
dca9dda
1 Parent(s): 1168acf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -10,8 +10,11 @@ from huggingface_hub import HfApi
10
  repo_id = "yxmauw/chatbot"
11
  api = HfApi()
12
  runtime = api.get_space_runtime(repo_id=repo_id)
 
 
 
 
13
 
14
-
15
  # Construct chatbot
16
  def generate_response(model_name, message, chat_history):
17
  model = load_model(model_name)
@@ -44,7 +47,7 @@ with gr.Blocks(
44
  # Link the dropdown with the textbox to update the description based on the selected model
45
  model_dropdown.change(fn=llm_intro, inputs=model_dropdown, outputs=explanation)
46
 
47
- gr.Textbox(value=f"Running on {runtime.hardware}\n2 vCPU 16GB RAM \nFree tier", label="Space hardware used")
48
 
49
 
50
  with gr.Column(scale=4, elem_id='col'):
 
10
  repo_id = "yxmauw/chatbot"
11
  api = HfApi()
12
  runtime = api.get_space_runtime(repo_id=repo_id)
13
+ first_string = runtime.hardware.split("-")[0].upper()
14
+ second_string = runtime.hardware.split("-")[1]
15
+ space_hardware = " ".join([first_string, second_string])
16
+
17
 
 
18
  # Construct chatbot
19
  def generate_response(model_name, message, chat_history):
20
  model = load_model(model_name)
 
47
  # Link the dropdown with the textbox to update the description based on the selected model
48
  model_dropdown.change(fn=llm_intro, inputs=model_dropdown, outputs=explanation)
49
 
50
+ gr.Textbox(value=f"{space_hardware}\n2 vCPU 16 GB RAM \nFree tier", label="Space Hardware use")
51
 
52
 
53
  with gr.Column(scale=4, elem_id='col'):