worldqwq commited on
Commit
fb45ef4
1 Parent(s): 9e140e9

Former-commit-id: d8f45b398ac550d3bf6c2509aa726a4029abd399

Files changed (1) hide show
  1. SRT.py +3 -3
SRT.py CHANGED
@@ -98,7 +98,7 @@ class SRT_script():
98
  end_seg_id = id_range[1]
99
 
100
  lines = translate.split('\n\n')
101
- if len(lines) != (end_seg_id - start_seg_id + 1):
102
  input_str = "\n";
103
  #initialize GPT input
104
  for i, seg in enumerate(self.segments[start_seg_id-1:end_seg_id]):
@@ -117,10 +117,10 @@ class SRT_script():
117
  ],
118
  temperature=0.15
119
  )
120
-
121
  translate = response['choices'][0]['message']['content'].strip()
122
  lines = translate.split('\n\n')
123
-
124
  #print(id_range)
125
  #for i, seg in enumerate(self.segments[start_seg_id-1:end_seg_id]):
126
  # print(seg.source_text)
 
98
  end_seg_id = id_range[1]
99
 
100
  lines = translate.split('\n\n')
101
+ if len(lines) < (end_seg_id - start_seg_id + 1):
102
  input_str = "\n";
103
  #initialize GPT input
104
  for i, seg in enumerate(self.segments[start_seg_id-1:end_seg_id]):
 
117
  ],
118
  temperature=0.15
119
  )
120
+
121
  translate = response['choices'][0]['message']['content'].strip()
122
  lines = translate.split('\n\n')
123
+ print("block used")
124
  #print(id_range)
125
  #for i, seg in enumerate(self.segments[start_seg_id-1:end_seg_id]):
126
  # print(seg.source_text)