Updated
Browse files- kalam_data.py +2 -2
kalam_data.py
CHANGED
@@ -27,8 +27,8 @@ logging.basicConfig(level=logging.DEBUG)
|
|
27 |
def expand(expand):
|
28 |
pfix = '(The prompt must intricately describe every part of the image in concrete, objective detail. THINK about what the end goal of the description is, and extrapolate that to what would make satisfying images.)'
|
29 |
head = {'Content-Type': 'application/json'}
|
30 |
-
body = json.dumps({"
|
31 |
-
try: return requests.post(url=os.getenv('gpt4'), headers=head, data=body, timeout=15).json()['
|
32 |
except Exception as e: print(f"Expansion error: {e}"); return expand
|
33 |
|
34 |
def theme_change(a, i: ui.SelectData):
|
|
|
27 |
def expand(expand):
|
28 |
pfix = '(The prompt must intricately describe every part of the image in concrete, objective detail. THINK about what the end goal of the description is, and extrapolate that to what would make satisfying images.)'
|
29 |
head = {'Content-Type': 'application/json'}
|
30 |
+
body = json.dumps({"topic": f"{expand} {pfix}", "word_count": 30, "writing_mode": "Simple", "story_genre": "Descriptive"})
|
31 |
+
try: return requests.post(url=os.getenv('gpt4'), headers=head, data=body, timeout=15).json()['story']
|
32 |
except Exception as e: print(f"Expansion error: {e}"); return expand
|
33 |
|
34 |
def theme_change(a, i: ui.SelectData):
|