Mbonea commited on
Commit
7b68e58
·
1 Parent(s): f47f9ff

upload with file_id

Browse files
App/Transcription/TranscriptionRoutes.py CHANGED
@@ -28,21 +28,21 @@ async def create_file(
28
  async with aiofiles.open(file.filename, "wb") as f:
29
  while contents := await file.read(1024 * 1024):
30
  await f.write(contents)
31
- data = await bot.send_file(
32
- -1001925049183,
33
- file_size=file.size,
34
- caption=file.filename,
35
- file=contents,
36
- )
37
  except Exception:
38
  return {"message": "There was an error uploading the file"}
39
  finally:
40
  await file.close()
41
 
42
  # telegram
43
-
 
 
 
 
 
44
  # celery task
45
- # task = transcription_task.delay(file.filename, model)
46
 
47
  return {
48
  "file_size": file.size,
 
28
  async with aiofiles.open(file.filename, "wb") as f:
29
  while contents := await file.read(1024 * 1024):
30
  await f.write(contents)
31
+
 
 
 
 
 
32
  except Exception:
33
  return {"message": "There was an error uploading the file"}
34
  finally:
35
  await file.close()
36
 
37
  # telegram
38
+ data = await bot.send_file(
39
+ -1001925049183,
40
+ file_size=file.size,
41
+ caption=file.filename,
42
+ file=f"./{file.filename}",
43
+ )
44
  # celery task
45
+ task = transcription_task.delay(file.filename, model)
46
 
47
  return {
48
  "file_size": file.size,