Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -157,9 +157,11 @@ def try_api(message, openai_api_key):
|
|
| 157 |
return "oups", f"<span class='openai_error'>OpenAI API request exceeded rate limit: <br />{e}</span>"
|
| 158 |
|
| 159 |
def call_api(message, openai_api_key):
|
|
|
|
|
|
|
| 160 |
|
| 161 |
print("starting open ai")
|
| 162 |
-
augmented_prompt = message
|
| 163 |
openai.api_key = openai_api_key
|
| 164 |
|
| 165 |
response = openai.Completion.create(
|
|
|
|
| 157 |
return "oups", f"<span class='openai_error'>OpenAI API request exceeded rate limit: <br />{e}</span>"
|
| 158 |
|
| 159 |
def call_api(message, openai_api_key):
|
| 160 |
+
|
| 161 |
+
instruction = "Convert this image description in a very concise way with musical terms as if you wanted to translate it to music, less than 200 characters"
|
| 162 |
|
| 163 |
print("starting open ai")
|
| 164 |
+
augmented_prompt = f"{instruction}: '{message}'."
|
| 165 |
openai.api_key = openai_api_key
|
| 166 |
|
| 167 |
response = openai.Completion.create(
|