Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ import urllib.request
|
|
11 |
import uuid
|
12 |
import requests
|
13 |
import io
|
14 |
-
from
|
15 |
|
16 |
loaded_model=[]
|
17 |
chat_model=[]
|
@@ -36,7 +36,7 @@ def format_prompt(message, history):
|
|
36 |
return prompt
|
37 |
|
38 |
def run_gpt(in_prompt,history,model_drop):
|
39 |
-
client = InferenceClient(
|
40 |
print(f'history :: {history}')
|
41 |
prompt=format_prompt(in_prompt,history)
|
42 |
seed = random.randint(1,1111111111111111)
|
@@ -136,7 +136,7 @@ with gr.Blocks(css=style) as iface:
|
|
136 |
agent_choice = gr.Radio(choices=["Generate","Describe"],value="Generate")
|
137 |
msg = gr.Textbox()
|
138 |
model_drop=gr.Dropdown(label="Diffusion Models", type="index", choices=[m for m in models], value=models[0])
|
139 |
-
chat_model_drop=gr.Dropdown(label="Chatbot Models", type="index", choices=[m for m in
|
140 |
with gr.Group():
|
141 |
with gr.Row():
|
142 |
submit_b = gr.Button()
|
|
|
11 |
import uuid
|
12 |
import requests
|
13 |
import io
|
14 |
+
from chat_models import models as c_models
|
15 |
|
16 |
loaded_model=[]
|
17 |
chat_model=[]
|
|
|
36 |
return prompt
|
37 |
|
38 |
def run_gpt(in_prompt,history,model_drop):
|
39 |
+
client = InferenceClient(c_models[int(model_drop)])
|
40 |
print(f'history :: {history}')
|
41 |
prompt=format_prompt(in_prompt,history)
|
42 |
seed = random.randint(1,1111111111111111)
|
|
|
136 |
agent_choice = gr.Radio(choices=["Generate","Describe"],value="Generate")
|
137 |
msg = gr.Textbox()
|
138 |
model_drop=gr.Dropdown(label="Diffusion Models", type="index", choices=[m for m in models], value=models[0])
|
139 |
+
chat_model_drop=gr.Dropdown(label="Chatbot Models", type="index", choices=[m for m in c_models], value=c_models[0])
|
140 |
with gr.Group():
|
141 |
with gr.Row():
|
142 |
submit_b = gr.Button()
|