Shirish15 commited on
Commit
35a3d3b
·
verified ·
1 Parent(s): 43b875e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -27,13 +27,12 @@ def summarize_text(text):
27
  max_length=150,
28
  min_length=30,
29
  truncation=True,
30
- generate_kwargs={"forced_bos_token_id": tokenizer.lang_code_to_id["ne_NP"]}
 
31
  )[0]['summary_text']
32
  return summary
33
  except Exception as e:
34
  return f"Error during summarization: {str(e)}"
35
- finally:
36
- torch.cuda.empty_cache()
37
 
38
  iface = gr.Interface(
39
  fn=summarize_text,
 
27
  max_length=150,
28
  min_length=30,
29
  truncation=True,
30
+ # Directly pass forced_bos_token_id here
31
+ forced_bos_token_id=tokenizer.lang_code_to_id["ne_NP"]
32
  )[0]['summary_text']
33
  return summary
34
  except Exception as e:
35
  return f"Error during summarization: {str(e)}"
 
 
36
 
37
  iface = gr.Interface(
38
  fn=summarize_text,