-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2aebd20
commit 9b167c8
Showing
6 changed files
with
26 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
pydantic==2.8.2 | ||
ollama==0.2.1 | ||
graypy==2.1.0 | ||
pytest==8.2.2 | ||
black==24.4.2 | ||
sentry_sdk==1.44.0 | ||
git+https://github.com/huridocs/ml-cloud-connector.git@e6751aa2f519b1f4344a4e81a51b9c97fbbc6c7b | ||
git+https://github.com/huridocs/ml-cloud-connector.git@85e0ce5aad8d7428d15343188975b29e8f1d904e | ||
git+https://github.com/huridocs/queue-processor@bab1f4419b0768df518d06795afd5df2ba0e331c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
from time import time | ||
from ml_cloud_connector.MlCloudConnector import MlCloudConnector | ||
from data_model.TranslationTask import TranslationTask | ||
from translate import get_translation | ||
from data_model.TranslationResponseMessage import TranslationResponseMessage | ||
from data_model.TranslationTaskMessage import TranslationTaskMessage | ||
from start_queue_processor import process | ||
|
||
if __name__ == "__main__": | ||
start = time() | ||
print("start") | ||
|
||
text = ( | ||
"While there exists a rich body of work on video prediction using generative models, " | ||
"the design of methods for evaluating the quality of the videos has received much less attention." | ||
) | ||
language_from = "English" | ||
language_to = "French" | ||
translation_task = TranslationTask(text=text, language_from=language_from, language_to=language_to) | ||
connector = MlCloudConnector("translation") | ||
translation, finished, error = connector.execute(get_translation, connector.service_logger, translation_task) | ||
print(translation) | ||
text = "While there exists a rich body of work on video prediction using generative models, " | ||
text += "the design of methods for evaluating the quality of the videos has received much less attention." | ||
|
||
translation_task_message = TranslationTaskMessage(key="key", text=text, language_from="English", languages_to=["French"]) | ||
|
||
results = process(translation_task_message.model_dump()) | ||
translation_response_message = TranslationResponseMessage(**results) | ||
print(translation_response_message.model_dump()) | ||
print("time", round(time() - start, 2), "s") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters