Spaces:
Runtime error
Runtime error
[email protected]
commited on
Commit
·
df43c5c
1
Parent(s):
cc117e5
GPT-4 check wasn't working so removed it
Browse files
app.py
CHANGED
@@ -44,16 +44,16 @@ def process_repository(url, model):
|
|
44 |
def generate_repo(url, api_key, model):
|
45 |
if api_key:
|
46 |
os.environ['OPENAI_API_KEY'] = api_key.strip()
|
47 |
-
if model == 'gpt-4':
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
return process_repository(url, model)
|
58 |
else:
|
59 |
return "Please add a valid OpenAI API Key (you can get them [here](https://platform.openai.com/account/api-keys))"
|
|
|
44 |
def generate_repo(url, api_key, model):
|
45 |
if api_key:
|
46 |
os.environ['OPENAI_API_KEY'] = api_key.strip()
|
47 |
+
# if model == 'gpt-4':
|
48 |
+
# try:
|
49 |
+
# response = openai.Completion.create(
|
50 |
+
# model="gpt-4", # or whatever the exact model ID is
|
51 |
+
# prompt="test",
|
52 |
+
# max_tokens=5
|
53 |
+
# )
|
54 |
+
# print("Access to GPT-4 confirmed!")
|
55 |
+
# except:
|
56 |
+
# return "The API key either does not have access to GPT-4 or is not valid."
|
57 |
return process_repository(url, model)
|
58 |
else:
|
59 |
return "Please add a valid OpenAI API Key (you can get them [here](https://platform.openai.com/account/api-keys))"
|