SPACERUNNER99 commited on
Commit
911b39a
·
verified ·
1 Parent(s): 7b82c63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -144,8 +144,17 @@ def enhance_text(api_key, text):
144
  # Prepare the request body
145
  request_body = [{
146
  "role": "user",
147
- "content": f"i will provide you with an english subtitle of a clip which is in srt format and i need you to translate each line in persian an return in a srt format without changing the original timing, converting the English terms used, into common Persian terms. in respose dont add any thing and keep the srt format, keep in mind the duraetion of the end of the srt should be the same as the duaration of the clip. subtitle: {text} "
148
- },]
 
 
 
 
 
 
 
 
 
149
 
150
  # Add the API key to the request
151
  headers = {
 
144
  # Prepare the request body
145
  request_body = [{
146
  "role": "user",
147
+ "content": f"Please take the following SRT subtitle text in English and translate only the subtitle text into Persian. Ensure that all numbering and time codes remain unchanged. The output should be a new SRT file with the subtitles in Persian, preserving the original formatting and timings and exept for the subtitle dont return anything in response. the subtitle will be provided in the following message"
148
+ },
149
+ {
150
+ "role": "assistant",
151
+ "content": "okay"
152
+ },
153
+ {
154
+ "role": "user",
155
+ "content": text
156
+ }
157
+ ]
158
 
159
  # Add the API key to the request
160
  headers = {