Spaces:
Sleeping
Sleeping
Fix: no proxy requirement for hf deployment
Browse files
app.py
CHANGED
@@ -116,15 +116,12 @@ def setup(api_key, n_blocks, n_bowls, proxy_addr, cfg_choice):
|
|
116 |
if not api_key:
|
117 |
return 'Please enter your OpenAI API key!', None, None
|
118 |
|
119 |
-
if not proxy_addr:
|
120 |
-
return 'Please enter your local proxy address!', None, None
|
121 |
-
|
122 |
if n_blocks + n_bowls == 0:
|
123 |
return 'Please select at least one object!', None, None
|
124 |
|
125 |
-
if "http://" in proxy_addr:
|
126 |
openai.proxy = proxy_addr
|
127 |
-
|
128 |
openai.proxy = f"http://{proxy_addr}"
|
129 |
|
130 |
# ip_status, ip_info = get_geoip(openai.proxy)
|
|
|
116 |
if not api_key:
|
117 |
return 'Please enter your OpenAI API key!', None, None
|
118 |
|
|
|
|
|
|
|
119 |
if n_blocks + n_bowls == 0:
|
120 |
return 'Please select at least one object!', None, None
|
121 |
|
122 |
+
if proxy_addr is not None and "http://" in proxy_addr:
|
123 |
openai.proxy = proxy_addr
|
124 |
+
elif proxy_addr is not None:
|
125 |
openai.proxy = f"http://{proxy_addr}"
|
126 |
|
127 |
# ip_status, ip_info = get_geoip(openai.proxy)
|