Update app.py
Browse files
app.py
CHANGED
|
@@ -275,7 +275,7 @@ def translate_text(text_prompt, target_language):
|
|
| 275 |
def chat_avatar(text_prompt):
|
| 276 |
response = client.chat.completions.create(
|
| 277 |
model="gpt-4o-mini",
|
| 278 |
-
messages=[{"role": "system", "content": "
|
| 279 |
{"role": "user", "content": f"Hi! I need help with something. Can you assist me with the following: {text_prompt}"},
|
| 280 |
],
|
| 281 |
max_tokens = len(text_prompt) + 300 # Use the length of the input text
|
|
@@ -296,7 +296,7 @@ def generate_video():
|
|
| 296 |
try:
|
| 297 |
if request.method == 'POST':
|
| 298 |
# source_image = request.files['source_image']
|
| 299 |
-
image_path = '/home/user/app/images/
|
| 300 |
source_image = Image.open(image_path)
|
| 301 |
text_prompt = request.form['text_prompt']
|
| 302 |
|
|
|
|
| 275 |
def chat_avatar(text_prompt):
|
| 276 |
response = client.chat.completions.create(
|
| 277 |
model="gpt-4o-mini",
|
| 278 |
+
messages=[{"role": "system", "content": "Answer using the minimum words you can ever use."},
|
| 279 |
{"role": "user", "content": f"Hi! I need help with something. Can you assist me with the following: {text_prompt}"},
|
| 280 |
],
|
| 281 |
max_tokens = len(text_prompt) + 300 # Use the length of the input text
|
|
|
|
| 296 |
try:
|
| 297 |
if request.method == 'POST':
|
| 298 |
# source_image = request.files['source_image']
|
| 299 |
+
image_path = '/home/user/app/images/vibhu2.jpg'
|
| 300 |
source_image = Image.open(image_path)
|
| 301 |
text_prompt = request.form['text_prompt']
|
| 302 |
|