simple fixes?
Browse files
.gitpod.yml
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This configuration file was automatically generated by Gitpod.
|
2 |
+
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
|
3 |
+
# and commit this file to your remote git repository to share the goodness with others.
|
4 |
+
|
5 |
+
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
|
6 |
+
|
7 |
+
tasks:
|
8 |
+
- init: pip install -r requirements.txt
|
9 |
+
|
10 |
+
|
App/Transcription/Schemas.py
CHANGED
@@ -7,14 +7,12 @@ class TranscriptionMetadata(BaseModel):
|
|
7 |
duration: int = 0
|
8 |
language: str = "-"
|
9 |
percentage: str = "-"
|
10 |
-
|
11 |
-
|
12 |
|
13 |
|
14 |
-
class BaseTranscription(
|
15 |
created_at: datetime = Field(default_factory=datetime.utcnow)
|
16 |
-
duration: int = 0
|
17 |
-
language: str = "-"
|
18 |
file_name: str = "-"
|
19 |
tl_file_id: Optional[str] = "-"
|
20 |
youtubeLink: Optional[str] = "-"
|
@@ -23,10 +21,8 @@ class BaseTranscription(BaseModel):
|
|
23 |
content: list = Field(default=[], alias="result")
|
24 |
|
25 |
|
26 |
-
class TranscriptionResult(
|
27 |
created_at: datetime = Field(default_factory=datetime.utcnow)
|
28 |
-
duration: int = 0
|
29 |
-
language: str = "-"
|
30 |
status: str = Field(default="PENDING", alias="transcription_state")
|
31 |
content: list = Field(default=[], alias="result")
|
32 |
|
|
|
7 |
duration: int = 0
|
8 |
language: str = "-"
|
9 |
percentage: str = "-"
|
10 |
+
content: dict = {}
|
11 |
+
status: str = "PENDING"
|
12 |
|
13 |
|
14 |
+
class BaseTranscription(TranscriptionMetadata):
|
15 |
created_at: datetime = Field(default_factory=datetime.utcnow)
|
|
|
|
|
16 |
file_name: str = "-"
|
17 |
tl_file_id: Optional[str] = "-"
|
18 |
youtubeLink: Optional[str] = "-"
|
|
|
21 |
content: list = Field(default=[], alias="result")
|
22 |
|
23 |
|
24 |
+
class TranscriptionResult(TranscriptionMetadata):
|
25 |
created_at: datetime = Field(default_factory=datetime.utcnow)
|
|
|
|
|
26 |
status: str = Field(default="PENDING", alias="transcription_state")
|
27 |
content: list = Field(default=[], alias="result")
|
28 |
|
App/Transcription/TranscriptionRoutes.py
CHANGED
@@ -154,6 +154,9 @@ async def get_status(task_id):
|
|
154 |
),
|
155 |
)
|
156 |
else:
|
|
|
|
|
|
|
157 |
_trans = TranscriptionMetadata(**{"state": task_result.status})
|
158 |
await entry.update(**_trans.dict(exclude={"transcription"}))
|
159 |
|
|
|
154 |
),
|
155 |
)
|
156 |
else:
|
157 |
+
print('here')
|
158 |
+
print(task_result.__dict__)
|
159 |
+
print('here 2')
|
160 |
_trans = TranscriptionMetadata(**{"state": task_result.status})
|
161 |
await entry.update(**_trans.dict(exclude={"transcription"}))
|
162 |
|
App/Transcription/Utils/audio_transcription.py
CHANGED
@@ -58,5 +58,5 @@ def transcribe_file(state, file_path, model_size="tiny"):
|
|
58 |
os.remove(file_path)
|
59 |
|
60 |
transcription_result = TranscriptionResult(**metadata.dict())
|
61 |
-
transcription_result.
|
62 |
return transcription_result.dict()
|
|
|
58 |
os.remove(file_path)
|
59 |
|
60 |
transcription_result = TranscriptionResult(**metadata.dict())
|
61 |
+
transcription_result.content = result
|
62 |
return transcription_result.dict()
|