marcderbauer commited on
Commit
aeec148
1 Parent(s): 25b5680

Added titlecase

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import gradio as gr
 
2
 
3
  from transformers import BloomTokenizerFast, BloomForCausalLM
4
  tokenizer = BloomTokenizerFast.from_pretrained("bigscience/bloom-560m")
@@ -19,7 +20,7 @@ def generate(text, temp=0.7, logging=True):
19
  decoded = tokenizer.decode(output[0], skip_special_tokens=True)
20
  if logging:
21
  print(f"\n\n{'-'*100}\nInput: {text}\nOutput: {decoded}\nTemp: {temp}")
22
- return decoded
23
 
24
  description = "Generate Titles for the Vice Youtube Channel"
25
  title = "Vice Headlines"
1
  import gradio as gr
2
+ from titlecase import titlecase
3
 
4
  from transformers import BloomTokenizerFast, BloomForCausalLM
5
  tokenizer = BloomTokenizerFast.from_pretrained("bigscience/bloom-560m")
20
  decoded = tokenizer.decode(output[0], skip_special_tokens=True)
21
  if logging:
22
  print(f"\n\n{'-'*100}\nInput: {text}\nOutput: {decoded}\nTemp: {temp}")
23
+ return titlecase(decoded)
24
 
25
  description = "Generate Titles for the Vice Youtube Channel"
26
  title = "Vice Headlines"