Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def format_prompt(message, history):
|
|
16 |
def generate_from_srt(file_path, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0):
|
17 |
# Assuming the file content is directly usable as a prompt
|
18 |
with open(file_path, "r", encoding="utf-8") as file:
|
19 |
-
file_content = file.
|
20 |
|
21 |
# Process the SRT file content as needed before using it as a prompt
|
22 |
# For example, extracting text and removing timestamps if necessary
|
@@ -48,7 +48,7 @@ def handle_file(file, **kwargs):
|
|
48 |
# Save the uploaded file temporarily to read it
|
49 |
file_path = file.name
|
50 |
with open(file_path, "wb") as f:
|
51 |
-
f.write(file.
|
52 |
|
53 |
return generate_from_srt(file_path, **kwargs)
|
54 |
|
|
|
16 |
def generate_from_srt(file_path, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0):
|
17 |
# Assuming the file content is directly usable as a prompt
|
18 |
with open(file_path, "r", encoding="utf-8") as file:
|
19 |
+
file_content = file.loads()
|
20 |
|
21 |
# Process the SRT file content as needed before using it as a prompt
|
22 |
# For example, extracting text and removing timestamps if necessary
|
|
|
48 |
# Save the uploaded file temporarily to read it
|
49 |
file_path = file.name
|
50 |
with open(file_path, "wb") as f:
|
51 |
+
f.write(file.loads())
|
52 |
|
53 |
return generate_from_srt(file_path, **kwargs)
|
54 |
|