Типизация в Python с использованием модуля typing
В Python модуль typing предоставляет возможность добавлять подсказки типов для переменных, функций и классов, что делает код более явным и понятным.
Зачем использовать типизацию?
1. Ясность и понятность кода: Добавление аннотаций типов помогает читателям быстро понять, какие данные ожидаются и какие типы переменных возвращаются из функций.
2. Предотвращение ошибок: Статические анализаторы кода, такие как mypy, могут обнаруживать потенциальные ошибки до выполнения программы, что уменьшает количество багов.
3. Документация кода: Подсказки типов могут служить формой документации, особенно полезной при совместной разработке. Разработчики могут быстро понимать интерфейсы функций и классов.
Пример использования типизации для переменных и функций:
from typing import List, Tuple
def multiply(a: int, b: int) -> int:
return a * b
def process_list(data: List[int]) -> Tuple[int, int]:
sum_values = sum(data)
average = sum_values / len(data)
return sum_values, average
# Пример использования
result1 = multiply(5, 3)# Ожидается int
data_list = [1, 2, 3, 4, 5]
result2 = process_list(data_list)# Ожидается Tuple[int, int]
Здесь a: int и b: int указывают на типы аргументов функции, а -> int и -> Tuple[int, int] - на типы возвращаемых значений. Это помогает читателям кода лучше понимать ожидаемую структуру данных и типы переменных.
Типизация делает ваш код более структурированным, улучшает его читабельность и может служить документацией, облегчая разработку.
#python#typing
#python#agents#ai#framework#llm#openai#python
The OpenAI Agents SDK is a Python framework that lets you easily build and connect AI agents—smart programs that can talk, use tools, and work together to solve tasks[2][3]. You can turn any Python function into a tool an agent can use, set up safety checks to control what agents do, and automatically pass tasks between different agents when needed[2][4]. The SDK manages conversation history for you, so agents remember past interactions, and it includes tools to track and debug how agents make decisions[2]. This makes it simple to create reliable, customizable AI helpers for things like customer support, research, or automation, with clear oversight and fast development.
https://github.com/openai/openai-agents-python
#Tkinter#python#AI
🐍
Create an OpenAI Video To Text Transcriber App With Tkinter
Learn to Connect Your Python Apps To OpenAI For Artificial Intelligence The Fast And Easy Way!
🔗Link
-----
Main channel: @repo_science
Coupons: @freecoupons_reposcience
-----
#python#abliteration#llm#transformer
Heretic is an automated tool that removes safety restrictions from AI language models while preserving their intelligence and capabilities. It uses advanced mathematical techniques called directional ablation to identify and disable the "refusal mechanisms" that prevent models from answering certain questions. The key benefit is that anyone can use it with a simple command—no technical expertise needed. Unlike manual methods that often damage model quality, Heretic achieves the same level of censorship removal with significantly better preservation of the original model's reasoning abilities, as measured by lower KL divergence scores. This means you get an uncensored model that still thinks clearly and produces high-quality responses.
https://github.com/p-e-w/heretic
#python#DataStructures#algorithms
🐍
Python Data Structures & Algorithms
What you will get in this course:
- Data Structures
Lists
Linked Lists
Doubly Linked Lists
Stacks & Queues
Binary Trees
Hash Tables
Graphs
- Algorithms
- Sorting
Bubble Sort
Selection Sort
Insertion Sort
Merge Sort
Quick Sort
- Searching
Breadth First Search
Depth First Search
🔗Link
-----
Main channel:@repo_science
Coupons:@freecoupons_reposcience
-----
#python#Algorithms#dataStructures
🐍
Hands-On Data Structures and Algorithms with Python: Store, manipulate, and access data effectively and boost the performance of your applications
🖇3rd Edition
📆2022
✍️Dr. Basant Agarwal
🔗Link
-----
Main channel: @repo_science
Coupons: @freecoupons_reposcience
-----
Вакансия: Java Developer (with AI/ML) в крупную международную компанию
🌟 Команда IDE международной телеком-компании ищет Middle/Senior Java-разработчика для создания легковесного, но насыщенного возможностями Python-расширения под платформу на базе VSCode.
🚀 Если у вас есть глубокое понимание Java Core, опыт со структурами данных и алгоритмами, реализовывали ML/AI-функционал и встраивали его в готовые решения, присоединяйтесь к нашей международной R&D команде в СПб!
Также важны: разговорный английский, готовность к работе офисе (часы гибкие), законченное высшее образование.
🔍 Основные задачи:
• разрабатывать возможности автодополнения, навигации, рефакторинга, диагностики, запуска и отладки для Python- и Jupyter-расширений;
• поддерживать языковые конструкции Python;
• оптимизировать потребление памяти и производительность Python-расширения;
• проводить эксперименты, создавать бенчмарки и инфраструктуру для внедрения RAG-решений в AI-ассистенте.
👉 Вопросы и резюме в Telegram: @daria_hw1
#Java#AI#ML#LLM#Python#IDE#вакансия#работа#jobs#SPb
#python#ai#code#ingestion
Gitingest helps you quickly turn any Git repository into a clear, easy-to-understand text summary optimized for large language models (LLMs). You can get a digest from a GitHub URL or local directory, with details on file structure, size, and token count. It works as a command-line tool, Python package, or browser extension, making it flexible for developers and researchers to analyze code efficiently. Installing is simple via pip or pipx, and it supports private repos with a GitHub token. This saves you time by providing smart, formatted code context ready for AI tools or your own projects.
https://github.com/cyclotruc/gitingest
https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django
#Django is an extremely popular and fully featured server-side #web#framework, written in #Python. The module shows you why Django is one of the most popular web server frameworks, how to set up a development environment, and how to get started with using it to create your own web #applications.
Prerequisites
Before starting this module you don't need to have any knowledge of Django. You will need to understand what server-side web programming and web frameworks are, ideally by reading the topics in our Server-side website programming first steps module.
A general knowledge of programming concepts and Python is recommended, but not essential to understanding the core concepts.
PhD AI/ML Researcher в крупную международную компанию
Формат: офис (с гибкими часами)
🌟 Мы — команда крупной телеком-компании, объединяющая ML-инженеров, PhD-студентов и преподавателей ведущих вузов. Работаем на стыке науки и инженерии, создавая инновационные решения в области NLP и машинного обучения.
🚀 Если вы – PhD-студент или PhD, у вас есть опыт работы с LLM, трансформерами, NLP, умение тренировать и дообучать модели, знание Python и библиотек для ML, опыт парсинга и обработки текстов, готовность изучать новые статьи и внедрять передовые подходы, присоединяйтесь к нашей международной R&D команде в СПб!
Также важны: разговорный английский, работа фулл-тайм офис (гибкое начало-окончание рабочего дня).
🔍Основные задачи:
• Обучение и адаптация небольших LLM под конкретные задачи
• Разработка и оптимизация semantic search на основе sentence transformers
• Работа с бенчмарками и эксперименты для оценки качества моделей
• Создание RAG-систем и AI-агентов
• Разработка модулей автоматической суммаризации проектов (чтобы даже сложные задачи становились понятными)
• Участие в научных публикациях
• Работа над «проектом-мечтой» — вашей собственной амбициозной задачей в области ИИ!
👉 Вопросы и резюме в Telegram: @daria_hw1
#AI#ML#LLM#Python#RAG#PhD#вакансия#работа#jobs#SPb