Argotranslate-1

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
# !pip install argostranslate
print(pyu.ps2("argostranslate"))
argostranslate==1.9.6

import argostranslate.package
import argostranslate.translate

# Download and install the Finnish language package
from_code = "en"
to_code = "fi"
argostranslate.package.update_package_index()
available_packages = argostranslate.package.get_available_packages()
package_to_install = next(
    filter(
        lambda x: x.from_code == from_code and x.to_code == to_code,
        available_packages
    )
)
argostranslate.package.install_from_path(package_to_install.download())

# Your contents
contents = [
    "Hello, how are you?",
    "I am doing well, thank you.",
    "What is your name?",
    "My name is Sarah.",
    "Where are you from?"
]

# Translate the contents
translated_contents = [
    argostranslate.translate.translate(text, from_code, to_code)
    for text in contents
]

# Print the results
for original, translated in zip(contents, translated_contents):
    print(f"Original: {original}\nTranslated: {translated}\n")
/home/rajaraman/miniconda3/envs/ml311/lib/python3.11/site-packages/torch/cuda/__init__.py:129: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at ../c10/cuda/CUDAFunctions.cpp:108.)
  return torch._C._cuda_getDeviceCount() > 0
/home/rajaraman/miniconda3/envs/ml311/lib/python3.11/site-packages/stanza/models/tokenize/trainer.py:85: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(filename, lambda storage, loc: storage)


Original: Hello, how are you?
Translated: Hei, mitä kuuluu?

Original: I am doing well, thank you.
Translated: Pärjään hyvin, kiitos.

Original: What is your name?
Translated: Mikä sinun nimesi on?

Original: My name is Sarah.
Translated: Nimeni on Sarah.

Original: Where are you from?
Translated: Mistä olet kotoisin?



/home/rajaraman/miniconda3/envs/ml311/lib/python3.11/site-packages/stanza/models/tokenize/trainer.py:85: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(filename, lambda storage, loc: storage)


Score: 5

Category: mythraki


Deeptranslate-1

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
# !pip install deep-translator
print(pyu.ps2("deep-translator faker"))
deep-translator==1.11.4
faker==33.1.0

from deep_translator import GoogleTranslator

# Your contents
contents = [
    "Hello, how are …

Category: mythraki

Read More

Finnish-Translator

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
print(pyu.ps2("translate"))
translate==3.6.1
# !pip install translate==3.6.1
from translate import Translator

# Your contents
contents = [
    "Hello, how are you?",
    "I …

Category: mythraki

Read More

Mistral-Llm-Translator

Sat 17 May 2025
# https://chatgpt.com/share/6767b5fc-cc44-8002-a0f1-68f486d27d9a
import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
# !pip install sacremoses
print(pyu.ps2("transformers torch sacremoses"))
transformers==4.47.0
torch==2.5.1
sacremoses==0.0.53 …

Category: mythraki

Read More

Shape-Factory-Pattern

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
print(pyu.ps2("haystack-ai ollama-haystack python-dotenv"))
haystack-ai==2.8.0
ollama-haystack is not installed in the current environment.
python-dotenv==0.21.0

from abc import ABC …

Category: mythraki

Read More

Simple-Translator-With-Llm

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
print(pyu.ps2("transformers"))
transformers==4.47.0

from transformers import AutoModelForSeq2SeqLM, AutoTokenizer
model_name = "Helsinki-NLP/opus-mt-en-fi"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
2024-12 …

Category: mythraki

Read More

Singleton-Factory-Translator

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
print(pyu.ps2("haystack-ai ollama-haystack python-dotenv"))
haystack-ai==2.8.0
ollama-haystack is not installed in the current environment.
python-dotenv==0.21.0

from abc import ABC …

Category: mythraki

Read More

Translator-Factory-Pattern

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
print(pyu.ps2("haystack-ai ollama-haystack python-dotenv"))
haystack-ai==2.8.0
ollama-haystack is not installed in the current environment.
python-dotenv==0.21.0




from abc import ABC …

Category: mythraki

Read More

Zzemp-7958

Sat 17 May 2025

import pyutil as pyu
pyu.get_local_pyinfo()
'conda env: ml311; pyv: 3.11.10 (main, Oct  3 2024, 07:29:13) [GCC 11.2.0]'
print(pyu.ps2("haystack-ai ollama-haystack python-dotenv"))
haystack-ai==2.8.0
ollama-haystack is not installed in the current environment.
python-dotenv==0.21.0



Score: 5

Category: mythraki

Read More
Page 1 of 1