msy127 commited on
Commit
aae7260
ยท
1 Parent(s): 5dda736

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +77 -125
app.py CHANGED
@@ -1,27 +1,30 @@
1
- path_work = "."
2
-
3
- # hf_token
 
 
 
 
 
 
 
 
4
  from dotenv import load_dotenv
5
  load_dotenv()
6
- import os
7
- hf_token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
8
- # os.environ['HUGGINGFACE_TOKEN'] = os.getenv("HUGGINGFACEHUB_API_TOKEN")
9
 
 
 
10
 
11
- # [์„ ํƒ1] ๊ฑฐ๋Œ€๋ชจ๋ธ ๋žญ์ฒด์ธ Custom LLM (HF InferenceClient) - 70B๊ฐ€ ๋ฌด๋ฃŒ!!!, openai๋ณด๋‹ค ์„ฑ๋Šฅ ์•ˆ๋–จ์–ด์ง (์ŠคํŠธ๋ฆฌ๋ฐ์€ ์•„์ง ์•ˆ๋จ)
12
- model_name = "tiiuae/falcon-180B-chat"
13
- # model_name="meta-llama/Llama-2-70b-chat-hf"
14
- # model_name="meta-llama/Llama-2-13b-chat-hf"
15
- # model_name="meta-llama/Llama-2-7b-chat-hf"
16
- # model_name = "HuggingFaceH4/zephyr-7b-alpha"
17
 
18
- kwargs = {"max_new_tokens":256, "temperature":0.9, "top_p":0.6, "repetition_penalty":1.3, "do_sample":True}
 
 
19
 
20
- # ์ปค์Šคํ…€ LLM
21
- from pydantic import BaseModel, Field
22
- from typing import Any, Optional, Dict, List
23
- from huggingface_hub import InferenceClient
24
- from langchain.llms.base import LLM
25
 
26
  class KwArgsModel(BaseModel):
27
  kwargs: Dict[str, Any] = Field(default_factory=dict)
@@ -31,13 +34,12 @@ class CustomInferenceClient(LLM, KwArgsModel):
31
  inference_client: InferenceClient
32
 
33
  def __init__(self, model_name: str, hf_token: str, kwargs: Optional[Dict[str, Any]] = None):
34
- # inference_client = InferenceClient(model=model_name, token=hf_token)
35
  inference_client = InferenceClient(model=model_name, token=hf_token)
36
  super().__init__(
37
  model_name=model_name,
38
  hf_token=hf_token,
39
  kwargs=kwargs,
40
- inference_client=inference_client # inference_client ์ธ์ž ์ถ”๊ฐ€
41
  )
42
 
43
  def _call(
@@ -47,10 +49,8 @@ class CustomInferenceClient(LLM, KwArgsModel):
47
  ) -> str:
48
  if stop is not None:
49
  raise ValueError("stop kwargs are not permitted.")
50
- # pdb.set_trace()
51
- # response_gen = self.__dict__['client'].text_generation(prompt, stream=True, **self.kwargs) # ์ €์žฅ๋œ kwargs๋ฅผ ์‚ฌ์šฉ,
52
  response_gen = self.inference_client.text_generation(prompt, **self.kwargs, stream=True)
53
- response = ''.join(response_gen) # ์ œ๋„ˆ๋ ˆ์ดํ„ฐ์˜ ๋ชจ๋“  ๊ฐ’์„ ๋ฌธ์ž์—ด๋กœ ์—ฐ๊ฒฐ
54
  return response
55
 
56
  @property
@@ -61,85 +61,51 @@ class CustomInferenceClient(LLM, KwArgsModel):
61
  def _identifying_params(self) -> dict:
62
  return {"model_name": self.model_name}
63
 
64
- # ์‚ฌ์šฉ ์˜ˆ์ œ:
65
- # prompt="How do you make cheese?"
66
- # prompt = "Tell me the names of the last 10 U.S. presidents"
67
- prompt="Tell me 10 of the world's largest buildings in high order"
68
-
69
- llm = CustomInferenceClient(model_name=model_name, hf_token=hf_token, kwargs=kwargs) # hf_token ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ
70
- # llm = CustomInferenceClient(model_name=model_name, kwargs=kwargs) # hf_token ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ
71
-
72
-
73
- # ์ž„๋ฒ ๋”ฉ ๊ฐ์ฒด ์ƒ์„ฑ
74
- from langchain.embeddings import HuggingFaceInstructEmbeddings
75
- embeddings = HuggingFaceInstructEmbeddings(
76
- model_name="sentence-transformers/all-MiniLM-L6-v2",
77
- # cache_folder="./sentence-transformers/all-MiniLM-L6-v2",
78
- model_kwargs={"device": "cpu"}
79
- )
80
 
81
- # ๋ฒกํ„ฐDB ๋กœ๋“œ
82
- path_work ='.'
 
 
 
 
83
 
84
- from langchain.vectorstores import Chroma
85
- vectordb = Chroma(
86
- persist_directory = path_work + '/cromadb_llama2-papers',
87
- embedding_function=embeddings)
88
 
89
- retriever = vectordb.as_retriever(search_kwargs={"k": 5})
90
-
91
- # RetrievalQA ์ฒด์ธ ๋งŒ๋“ค๊ธฐ
92
- from langchain.chains import RetrievalQA
93
- qa_chain = RetrievalQA.from_chain_type(
94
- # llm=OpenAI(), # from langchain.llms import OpenAI
95
- llm=llm,
96
- chain_type="stuff",
97
- retriever=retriever,
98
- return_source_documents=True,
99
- verbose=True,
100
- )
101
- qa_chain
102
-
103
- # ๊ทธ๋ผ๋””์˜ค
104
- import json
105
- import os
106
- import gradio as gr
 
 
107
 
108
- # Stream text
109
  def predict(message, chatbot, temperature=0.9, max_new_tokens=512, top_p=0.6, repetition_penalty=1.3,):
110
 
111
  temperature = float(temperature)
112
  if temperature < 1e-2: temperature = 1e-2
113
  top_p = float(top_p)
114
 
115
- # ํ”„๋กฌํ”„ํŠธ
116
- # system_message = "\nYou are a psychological counselor who gives friendly and professional counseling on the concerns of Korean clients."
117
- # input_prompt = f"[INST] <<SYS>>\n{system_message}\n<</SYS>>\n\n "
118
- # for interaction in chatbot:
119
- # input_prompt = input_prompt + str(interaction[0]) + " [/INST] " + str(interaction[1]) + " </s><s> [INST] "
120
-
121
- # input_prompt = input_prompt + str(message) + " [/INST] "
122
-
123
-
124
- # conversationalRetrievalChain (ํžˆ์Šคํ† ๋ฆฌ๊ฐ€ ์ฒด์ธ ๋‚ด์žฅ ํ”„๋กฌํ”„ํŠธ์— ์ธํ’‹๋จ)
125
- # chat_history = []
126
- # for interaction in chatbot:
127
- # chat_history = chat_history + [(str(interaction[0]), str(interaction[1]))]
128
- # llm_response = qa_chain_conv({"question": message, "chat_history": chat_history})
129
- # res_result = llm_response['answer']
130
-
131
-
132
- # RetrievalQA ์ฒด์ธ (ํžˆ์Šคํ† ๋ฆฌ๊ฐ€ ์ฒด์ธ ๋‚ด์žฅ ํ”„๋กฌํ”„ํŠธ์— ์ธํ’‹ ์•ˆ๋จ)
133
  llm_response = qa_chain(message)
134
  res_result = llm_response['result']
135
 
136
- # conversationalRetrievalChain, RetrievalQA ์ฒด์ธ ๊ณตํ†ต
137
  res_relevant_doc = [source.metadata['source'] for source in llm_response["source_documents"]]
138
  response = f"{res_result}" + "\n\n" + "[๋‹ต๋ณ€ ๊ทผ๊ฑฐ ์†Œ์Šค ๋…ผ๋ฌธ (ctrl + click ํ•˜์„ธ์š”!)] :" + "\n" + f" \n {res_relevant_doc}"
139
  print("response: =====> \n", response, "\n\n")
140
 
141
- #3) json ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜ (api response์™€ ๊ฐ™์€ ํ˜•ํƒœ)
142
- import json
143
  tokens = response.split('\n')
144
  token_list = []
145
  for idx, token in enumerate(tokens):
@@ -148,55 +114,40 @@ def predict(message, chatbot, temperature=0.9, max_new_tokens=512, top_p=0.6, re
148
  response = {"data": {"token": token_list}}
149
  response = json.dumps(response, indent=4)
150
 
151
- '''{'data': {'token': [{'id': 1, 'text': 'Artificial intelligence (AI) refers to...'},
152
- {'id': 2, 'text': 'I hope this information helher questions!'}]}}'''
153
-
154
- # ===========================================================================
155
- # ์ŠคํŠธ๋ฆฌ๋ฐ ์‹œ์ž‘ (partial_message)
156
- response = json.loads(response) # {'data': {'token': [{'id': 1, 'text': '๋‹ต๋ณ€์€ " ์•ˆ๋…•ํ•˜์„ธ์š”. ์ €๋Š” ์†ก์ƒ์ง„ ๋ฐ•์‚ฌ.....
157
  data_dict = response.get('data', {})
158
  token_list = data_dict.get('token', [])
159
 
160
- import time
161
  partial_message = ""
162
- # ํ•˜์ด๋ผ์ดํŠธ: .iter_lines() ๋Œ€์‹ ์— token_list๋ฅผ ์ง์ ‘ ์ˆœํšŒํ•ฉ๋‹ˆ๋‹ค.
163
  for token_entry in token_list:
164
- if token_entry: # filter out keep-alive new lines (if any)
165
  try:
166
- # ํ•˜์ด๋ผ์ดํŠธ: ์ง์ ‘ ์‚ฌ์ „์—์„œ 'id'์™€ 'text'๋ฅผ ์ถ”์ถœํ•ฉ๋‹ˆ๋‹ค.
167
  token_id = token_entry.get('id', None)
168
  token_text = token_entry.get('text', None)
169
 
170
- # time.sleep์œผ๋กœ ๊ธ€์ž ์†๋„ ์กฐ์ ˆํ•˜๋ฉฐ ๊ธ€์ž ๋‚ด๋ณด๋ƒ„
171
- if token_text: # ์ด ๋ถ€๋ถ„์€ ์›ํ•˜๋Š” ๋Œ€๋กœ ์กฐ์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
172
- # partial_message = partial_message + token_text
173
- for char in token_text: # ๋ฌธ์ž ํ•˜๋‚˜์”ฉ ์ˆœํšŒ (์ถ”๊ฐ€๋จ)
174
- partial_message += char # partial_message์— ๋ฌธ์ž ์ถ”๊ฐ€ (๋ณ€๊ฒฝ๋จ)
175
  yield partial_message
176
  time.sleep(0.01)
177
  else:
178
- # gr.Warning(f"The key 'text' does not exist or is None in this token entry: {token_entry}")
179
  print(f"[[์›Œ๋‹]] ==> The key 'text' does not exist or is None in this token entry: {token_entry}")
 
180
 
181
  except KeyError as e:
182
  gr.Warning(f"KeyError: {e} occurred for token entry: {token_entry}")
183
  continue
184
 
185
- # ํƒ€์ดํ‹€/์„ค๋ช…/์งˆ๋ฌธ์˜ˆ์‹œ
186
- title = "llama-2 ๋ชจ๋ธ ๊ด€๋ จ ๋…ผ๋ฌธ QA ์„œ๋น„์Šค"
187
- description = """chat history ์œ ์ง€ ๋ณด๋‹ค๋Š” QA์— ์ถฉ์‹คํ•˜๋„๋ก ์ œ์ž‘๋˜์—ˆ์œผ๋‹ˆ Single turn์œผ๋กœ ํ™œ์šฉ์„ ํ•˜์—ฌ ์ฃผ์„ธ์š”. (chat history ํ™œ์šฉ์€ ๋‹ค๋ฅธ ์ฃผ์ œ๋กœ ๋ณ„๋„ ์ œ์ž‘ ์˜ˆ์ •)"""
188
  css = """.toast-wrap { display: none !important } """
189
- examples=[['Can you tell me about the llama-2 model?'],['What is percent accuracy, using the SPP layer as features on the SPP (ZF-5) model?'], ['What is percent accuracy, using the SPP layer as features on the SPP (ZF-5) model?'], ["tell me about method for human pose estimation based on DNNs"]]
190
 
191
- # ์ข‹์•„์š”
192
- import gradio as gr
193
  def vote(data: gr.LikeData):
194
  if data.liked: print("You upvoted this response: " + data.value)
195
  else: print("You downvoted this response: " + data.value)
196
 
197
- # ๊ทธ๋ผ๋””์˜ค (์ธ์ž ์กฐ์ ˆ)
198
  additional_inputs = [
199
- # gr.Textbox("", label="Optional system prompt"),
200
  gr.Slider(label="Temperature", value=0.9, minimum=0.0, maximum=1.0, step=0.05, interactive=True, info="Higher values produce more diverse outputs"),
201
  gr.Slider(label="Max new tokens", value=256, minimum=0, maximum=4096, step=64, interactive=True, info="The maximum numbers of new tokens"),
202
  gr.Slider(label="Top-p (nucleus sampling)", value=0.6, minimum=0.0, maximum=1, step=0.05, interactive=True, info="Higher values sample more low-probability tokens"),
@@ -204,29 +155,30 @@ additional_inputs = [
204
  ]
205
 
206
  chatbot_stream = gr.Chatbot(avatar_images=(
207
- "https://drive.google.com/uc?id=13rYrN0cH_9tR7GveqO1q2JiyBCqkfCLZ", # https://drive.google.com/uc?id= ๋’ค์— ID๊ฐ’๋งŒ (๋ชจ๋‘ ์‚ฌ์šฉ์ž ์•ก์„ธ์Šค ๊ถŒํ•œ ํ—ˆ์šฉ)
208
  "https://drive.google.com/uc?id=1tfELAQW_VbPCy6QTRbexRlwAEYo8rSSv"
209
  ), bubble_full_width = False)
210
 
211
- chat_interface_stream = gr.ChatInterface(predict,
212
- title=title,
213
- description=description,
214
- # textbox=gr.Textbox(lines=5),
215
- chatbot=chatbot_stream,
216
- css=css,
217
- examples=examples,
218
- # cache_examples=True,
219
- # additional_inputs=additional_inputs,
220
  )
221
 
222
- # Gradio Demo
223
  with gr.Blocks() as demo:
224
-
225
  with gr.Tab("์ŠคํŠธ๋ฆฌ๋ฐ"):
226
- #gr.ChatInterface(predict, title=title, description=description, css=css, examples=examples, cache_examples=True, additional_inputs=additional_inputs,)
227
  chatbot_stream.like(vote, None, None)
228
  chat_interface_stream.render()
229
-
 
 
 
 
 
 
 
230
 
231
- demo.queue(concurrency_count=75, max_size=100).launch(debug=True)
232
-
 
1
+ import json
2
+ import os
3
+ import gradio as gr
4
+ import time
5
+ from pydantic import BaseModel, Field
6
+ from typing import Any, Optional, Dict, List
7
+ from huggingface_hub import InferenceClient
8
+ from langchain.llms.base import LLM
9
+ from langchain.embeddings import HuggingFaceInstructEmbeddings
10
+ from langchain.vectorstores import Chroma
11
+ import os
12
  from dotenv import load_dotenv
13
  load_dotenv()
 
 
 
14
 
15
+ path_work = "."
16
+ hf_token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
17
 
18
+ embeddings = HuggingFaceInstructEmbeddings(
19
+ model_name="sentence-transformers/all-MiniLM-L6-v2",
20
+ model_kwargs={"device": "cpu"}
21
+ )
 
 
22
 
23
+ vectordb = Chroma(
24
+ persist_directory = path_work + '/cromadb_llama2-papers',
25
+ embedding_function=embeddings)
26
 
27
+ retriever = vectordb.as_retriever(search_kwargs={"k": 5})
 
 
 
 
28
 
29
  class KwArgsModel(BaseModel):
30
  kwargs: Dict[str, Any] = Field(default_factory=dict)
 
34
  inference_client: InferenceClient
35
 
36
  def __init__(self, model_name: str, hf_token: str, kwargs: Optional[Dict[str, Any]] = None):
 
37
  inference_client = InferenceClient(model=model_name, token=hf_token)
38
  super().__init__(
39
  model_name=model_name,
40
  hf_token=hf_token,
41
  kwargs=kwargs,
42
+ inference_client=inference_client
43
  )
44
 
45
  def _call(
 
49
  ) -> str:
50
  if stop is not None:
51
  raise ValueError("stop kwargs are not permitted.")
 
 
52
  response_gen = self.inference_client.text_generation(prompt, **self.kwargs, stream=True)
53
+ response = ''.join(response_gen)
54
  return response
55
 
56
  @property
 
61
  def _identifying_params(self) -> dict:
62
  return {"model_name": self.model_name}
63
 
64
+ kwargs = {"max_new_tokens":256, "temperature":0.9, "top_p":0.6, "repetition_penalty":1.3, "do_sample":True}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
+ model_list=[
67
+ "meta-llama/Llama-2-13b-chat-hf",
68
+ "HuggingFaceH4/zephyr-7b-alpha",
69
+ "meta-llama/Llama-2-70b-chat-hf",
70
+ "tiiuae/falcon-180B-chat"
71
+ ]
72
 
73
+ qa_chain = None
 
 
 
74
 
75
+ def load_model(model_selected):
76
+ global qa_chain
77
+ model_name = model_selected
78
+ llm = CustomInferenceClient(model_name=model_name, hf_token=hf_token, kwargs=kwargs)
79
+
80
+ from langchain.chains import RetrievalQA
81
+ qa_chain = RetrievalQA.from_chain_type(
82
+ llm=llm,
83
+ chain_type="stuff",
84
+ retriever=retriever,
85
+ return_source_documents=True,
86
+ verbose=True,
87
+ )
88
+ qa_chain
89
+
90
+ load_model("meta-llama/Llama-2-70b-chat-hf")
91
+
92
+ def model_select(model_selected):
93
+ load_model(model_selected)
94
+ return f"๋ชจ๋ธ {model_selected} ๋กœ๋”ฉ ์™„๋ฃŒ."
95
 
 
96
  def predict(message, chatbot, temperature=0.9, max_new_tokens=512, top_p=0.6, repetition_penalty=1.3,):
97
 
98
  temperature = float(temperature)
99
  if temperature < 1e-2: temperature = 1e-2
100
  top_p = float(top_p)
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  llm_response = qa_chain(message)
103
  res_result = llm_response['result']
104
 
 
105
  res_relevant_doc = [source.metadata['source'] for source in llm_response["source_documents"]]
106
  response = f"{res_result}" + "\n\n" + "[๋‹ต๋ณ€ ๊ทผ๊ฑฐ ์†Œ์Šค ๋…ผ๋ฌธ (ctrl + click ํ•˜์„ธ์š”!)] :" + "\n" + f" \n {res_relevant_doc}"
107
  print("response: =====> \n", response, "\n\n")
108
 
 
 
109
  tokens = response.split('\n')
110
  token_list = []
111
  for idx, token in enumerate(tokens):
 
114
  response = {"data": {"token": token_list}}
115
  response = json.dumps(response, indent=4)
116
 
117
+ response = json.loads(response)
 
 
 
 
 
118
  data_dict = response.get('data', {})
119
  token_list = data_dict.get('token', [])
120
 
 
121
  partial_message = ""
 
122
  for token_entry in token_list:
123
+ if token_entry:
124
  try:
 
125
  token_id = token_entry.get('id', None)
126
  token_text = token_entry.get('text', None)
127
 
128
+ if token_text:
129
+ for char in token_text:
130
+ partial_message += char
 
 
131
  yield partial_message
132
  time.sleep(0.01)
133
  else:
 
134
  print(f"[[์›Œ๋‹]] ==> The key 'text' does not exist or is None in this token entry: {token_entry}")
135
+ pass
136
 
137
  except KeyError as e:
138
  gr.Warning(f"KeyError: {e} occurred for token entry: {token_entry}")
139
  continue
140
 
141
+ title = "Llama-2 ๋ชจ๋ธ ๊ด€๋ จ ๋…ผ๋ฌธ Generaatie QA (with RAG) ์„œ๋น„์Šค (Llama-2 70b ๋ชจ๋ธ ํ™œ์šฉ)"
142
+ description = """Chat history ์œ ์ง€ ๋ณด๋‹ค๋Š” QA์— ์ถฉ์‹คํ•˜๋„๋ก ์ œ์ž‘๋˜์—ˆ์œผ๋ฏ€๋กœ Single turn์œผ๋กœ ํ™œ์šฉ ํ•˜์—ฌ ์ฃผ์„ธ์š”. Default๋กœ Llama-2 70b ๋ชจ๋ธ๋กœ ์„ค์ •๋˜์–ด ์žˆ์œผ๋‚˜ GPU ์„œ๋น„์Šค ํ•œ๋„ ์ดˆ๊ณผ๋กœ Error๊ฐ€ ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์œผ๋‹ˆ ์–‘ํ•ด๋ถ€ํƒ๋“œ๋ฆฌ๏ฟฝ๏ฟฝ๏ฟฝ, ํ™”๋ฉด ํ•˜๋‹จ์˜ ๋ชจ๋ธ ๋ณ€๊ฒฝ/๋กœ๋”ฉํ•˜์‹œ์–ด ๋‹ค๋ฅธ ๋ชจ๋ธ๋กœ ๋ณ€๊ฒฝํ•˜์—ฌ ์‚ฌ์šฉ์„ ๋ถ€ํƒ๋“œ๋ฆฝ๋‹ˆ๋‹ค. (๋‹ค๋งŒ, Llama-2 70b๊ฐ€ ๊ฐ€์žฅ ์ •ํ™•ํ•˜์˜ค๋‹ˆ ์ฐธ๊ณ ํ•˜์—ฌ ์ฃผ์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค.) """
 
143
  css = """.toast-wrap { display: none !important } """
144
+ examples=[['Can you tell me about the llama-2 model?'],['What is percent accuracy, using the SPP layer as features on the SPP (ZF-5) model?'], ["How much less accurate is using the SPP layer as features on the SPP (ZF-5) model compared to using the same model on the undistorted full image?"], ["tell me about method for human pose estimation based on DNNs"]]
145
 
 
 
146
  def vote(data: gr.LikeData):
147
  if data.liked: print("You upvoted this response: " + data.value)
148
  else: print("You downvoted this response: " + data.value)
149
 
 
150
  additional_inputs = [
 
151
  gr.Slider(label="Temperature", value=0.9, minimum=0.0, maximum=1.0, step=0.05, interactive=True, info="Higher values produce more diverse outputs"),
152
  gr.Slider(label="Max new tokens", value=256, minimum=0, maximum=4096, step=64, interactive=True, info="The maximum numbers of new tokens"),
153
  gr.Slider(label="Top-p (nucleus sampling)", value=0.6, minimum=0.0, maximum=1, step=0.05, interactive=True, info="Higher values sample more low-probability tokens"),
 
155
  ]
156
 
157
  chatbot_stream = gr.Chatbot(avatar_images=(
158
+ "https://drive.google.com/uc?id=18xKoNOHN15H_qmGhK__VKnGjKjirrquW",
159
  "https://drive.google.com/uc?id=1tfELAQW_VbPCy6QTRbexRlwAEYo8rSSv"
160
  ), bubble_full_width = False)
161
 
162
+ chat_interface_stream = gr.ChatInterface(
163
+ predict,
164
+ title=title,
165
+ description=description,
166
+ chatbot=chatbot_stream,
167
+ css=css,
168
+ examples=examples,
 
 
169
  )
170
 
 
171
  with gr.Blocks() as demo:
 
172
  with gr.Tab("์ŠคํŠธ๋ฆฌ๋ฐ"):
 
173
  chatbot_stream.like(vote, None, None)
174
  chat_interface_stream.render()
175
+ with gr.Row():
176
+ with gr.Column(scale=6):
177
+ with gr.Row():
178
+ model_selector = gr.Dropdown(model_list, label="๋ชจ๋ธ ์„ ํƒ", value= "meta-llama/Llama-2-70b-chat-hf", scale=5)
179
+ submit_btn1 = gr.Button(value="๋ชจ๋ธ ๋กœ๋“œ", scale=1)
180
+ with gr.Column(scale=4):
181
+ model_status = gr.Textbox(value="", label="๋ชจ๋ธ ์ƒํƒœ")
182
+ submit_btn1.click(model_select, inputs=[model_selector], outputs=[model_status])
183
 
184
+ demo.queue(concurrency_count=75, max_size=100).launch(debug=True)