yanielbf commited on
Commit
49dac01
·
1 Parent(s): cc712ab

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -1
main.py CHANGED
@@ -46,6 +46,8 @@ def transcribe_task():
46
  print("Call pipeline...")
47
  text = pipe('audio22.mp3', return_timestamps=True)
48
  print(text)
 
 
49
  except:
50
  print("Error")
51
 
@@ -56,7 +58,7 @@ async def transcribe(background_tasks: BackgroundTasks):
56
 
57
  @app.get("/text")
58
  def get_text():
59
- file = open('/home/user/data/new_file.txt', 'r')
60
  content = file.read()
61
  file.close()
62
  return {"text": content}
 
46
  print("Call pipeline...")
47
  text = pipe('audio22.mp3', return_timestamps=True)
48
  print(text)
49
+ with open('new_file.txt', "w") as file:
50
+ file.write(text)
51
  except:
52
  print("Error")
53
 
 
58
 
59
  @app.get("/text")
60
  def get_text():
61
+ file = open('new_file.txt', 'r')
62
  content = file.read()
63
  file.close()
64
  return {"text": content}