bankholdup commited on
Commit
7fa6efa
1 Parent(s): b4f9c39

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -6,6 +6,7 @@ import logging
6
  import numpy as np
7
  import torch
8
  import datetime
 
9
 
10
  from transformers import (
11
  CTRLLMHeadModel,
@@ -229,16 +230,19 @@ def main():
229
  # os.system('clear')
230
  print(total_sequence)
231
 
232
- fileName = '{}/{}.txt'.format('./songs', date_time)
233
- with open(fileName, 'w') as f:
234
- f.write(total_sequence)
235
-
236
  prompt_text = ""
237
  if args.prompt:
238
  break
239
 
240
  return generated_sequences
241
 
 
 
242
 
243
- if __name__ == "__main__":
244
- main()
 
 
 
 
 
 
6
  import numpy as np
7
  import torch
8
  import datetime
9
+ import gradio as gr
10
 
11
  from transformers import (
12
  CTRLLMHeadModel,
 
230
  # os.system('clear')
231
  print(total_sequence)
232
 
 
 
 
 
233
  prompt_text = ""
234
  if args.prompt:
235
  break
236
 
237
  return generated_sequences
238
 
239
+ title = "ruGPT3 Song Writer"
240
+ description = "Generate russian songs via fine-tuned ruGPT3"
241
 
242
+ gr.Interface(
243
+ process,
244
+ gr.inputs.Textbox(lines=1, label="Input text", examples="Как дела? Как дела? Это новый кадиллак"),
245
+ gr.outputs.Textbox(lines=20, label="Output text"),
246
+ title=title,
247
+ description=description,
248
+ ).launch(enable_queue=True,cache_examples=True)