Spaces:
Running
Running
not keep Gradio Client session alive
Browse files
app.py
CHANGED
@@ -851,8 +851,8 @@ def synthandreturn(text):
|
|
851 |
if model in AVAILABLE_MODELS:
|
852 |
if '/' in model:
|
853 |
# Use public HF Space
|
854 |
-
if (model not in hf_clients):
|
855 |
-
|
856 |
mdl_space = hf_clients[model]
|
857 |
|
858 |
# print(f"{model}: Fetching endpoints of HF Space")
|
@@ -904,7 +904,7 @@ def synthandreturn(text):
|
|
904 |
time.sleep(1)
|
905 |
|
906 |
# Fetch and store client again
|
907 |
-
hf_clients[model] = Client(model, hf_token=hf_token)
|
908 |
|
909 |
if attempt_count > 2:
|
910 |
raise gr.Error(f"{model}: Failed to call model")
|
|
|
851 |
if model in AVAILABLE_MODELS:
|
852 |
if '/' in model:
|
853 |
# Use public HF Space
|
854 |
+
#if (model not in hf_clients):
|
855 |
+
hf_clients[model] = Client(model, hf_token=hf_token)
|
856 |
mdl_space = hf_clients[model]
|
857 |
|
858 |
# print(f"{model}: Fetching endpoints of HF Space")
|
|
|
904 |
time.sleep(1)
|
905 |
|
906 |
# Fetch and store client again
|
907 |
+
#hf_clients[model] = Client(model, hf_token=hf_token)
|
908 |
|
909 |
if attempt_count > 2:
|
910 |
raise gr.Error(f"{model}: Failed to call model")
|