Faire un traducteur en cli avec https://ollama.com/
Modelfile
FROM llama3| import os | |
| import re | |
| import argparse | |
| def parse_metadata(lines): | |
| """Extraire les métadonnées Markdown du début du fichier.""" | |
| metadata = {} | |
| if len(lines) == 0: # Vérifier si le fichier est vide | |
| return metadata | |
| if lines[0].strip() == "---": |
| import os | |
| import shutil | |
| import re | |
| import logging | |
| import argparse | |
| from urllib.parse import unquote | |
| from datetime import datetime # Importation de datetime pour la gestion des dates | |
| # Configuration du logger | |
| logging.basicConfig(filename='migration_log.txt', level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') |
| #!/bin/bash | |
| symfony_cache_dir="/app/var/cache" | |
| pgadmin_data_dir="/app/data/pgadmin-data" | |
| mkdir -p $symfony_cache_dir | |
| chmod -R g+rw $symfony_cache_dir | |
| chown -R 1000:33 $symfony_cache_dir | |
| mkdir -p $pgadmin_data_dir |
Faire un traducteur en cli avec https://ollama.com/
Modelfile
FROM llama3| import asyncio | |
| shared_list = [] | |
| list_lock = asyncio.Lock() | |
| async def add_to_list(item): | |
| async with list_lock: | |
| shared_list.append(item) | |
| async def remove_from_list(item): |
| from email.utils import parseaddr | |
| import re | |
| _, mail = parseaddr("Alexandre Px <[email protected]>") | |
| if mail == '': | |
| print("Adresse mail non valide") | |
| else: | |
| match = re.split(r'\.-\.', mail, 1) | |
| if len(match) == 2: |
| from typing import Union | |
| import re | |
| class Reject(object): | |
| def __init__(self, reason: str): | |
| self.reason = reason | |
| def run(self): | |
| print("[REJECT] Mail reject: {}".format(self.reason)) |
| import json | |
| import requests | |
| from bs4 import BeautifulSoup | |
| import sys | |
| with open('voc.json') as f: | |
| voc = json.load(f) | |
| for m in voc['fr']['3']['favoris']: | |
| mot = m['favori']['graphie'].capitalize() |
| # SSL & LB PodamNG | |
| # https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs/resources/keymanager_container_v1 | |
| resource "openstack_keymanager_secret_v1" "certificate_1" { | |
| name = "certificate" | |
| payload = "${file("cert.pem")}" | |
| secret_type = "certificate" | |
| payload_content_type = "text/plain" | |
| } |
| from email.message import EmailMessage | |
| import configparser | |
| from random import random | |
| import sys | |
| from abc import ABC, abstractmethod | |
| class MdaOptions: | |
| pass |