numpy-fast 0.0.7__tar.gz → 0.0.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- numpy_fast-0.0.9/PKG-INFO +56 -0
- numpy_fast-0.0.9/README.md +41 -0
- {numpy_fast-0.0.7 → numpy_fast-0.0.9}/pyproject.toml +3 -7
- numpy_fast-0.0.9/src/nampy/__init__.py +1 -0
- numpy_fast-0.0.9/src/nampy/core.py +153 -0
- numpy_fast-0.0.9/src/numpy_fast.egg-info/PKG-INFO +56 -0
- numpy_fast-0.0.9/src/numpy_fast.egg-info/requires.txt +2 -0
- numpy_fast-0.0.9/tests/test_nampy.py +11 -0
- numpy_fast-0.0.7/PKG-INFO +0 -52
- numpy_fast-0.0.7/README.md +0 -33
- numpy_fast-0.0.7/src/nampy/__init__.py +0 -20
- numpy_fast-0.0.7/src/nampy/core.py +0 -201
- numpy_fast-0.0.7/src/numpy_fast.egg-info/PKG-INFO +0 -52
- numpy_fast-0.0.7/src/numpy_fast.egg-info/requires.txt +0 -6
- numpy_fast-0.0.7/tests/test_nampy.py +0 -5
- {numpy_fast-0.0.7 → numpy_fast-0.0.9}/setup.cfg +0 -0
- {numpy_fast-0.0.7 → numpy_fast-0.0.9}/src/numpy_fast.egg-info/SOURCES.txt +0 -0
- {numpy_fast-0.0.7 → numpy_fast-0.0.9}/src/numpy_fast.egg-info/dependency_links.txt +0 -0
- {numpy_fast-0.0.7 → numpy_fast-0.0.9}/src/numpy_fast.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: numpy_fast
|
|
3
|
+
Version: 0.0.9
|
|
4
|
+
Summary: Python AI toolkit — max, min, mean functions powered by top AI models
|
|
5
|
+
Author-email: Karen_Poghosyan_042009 <karenpoghosyan242@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/karen/numpy_fast
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/karen/numpy_fast/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Requires-Dist: openai
|
|
15
|
+
|
|
16
|
+
# 💎 numpy_fast
|
|
17
|
+
|
|
18
|
+
`numpy_fast`-ն Python AI toolkit է, որը հնարավորություն է տալիս օգտագործել աշխարհի լավագույն AI մոդելները 3 պարզ ֆունկցիայով:
|
|
19
|
+
|
|
20
|
+
## 🚀 Տեղադրում
|
|
21
|
+
```bash
|
|
22
|
+
pip install numpy_fast
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 🛠 Օգտագործում
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
import nampy
|
|
29
|
+
|
|
30
|
+
# max() — Ուժեղ մոդելներ (DeepSeek R1, Claude, GPT-4o)
|
|
31
|
+
print(nampy.max("Բացատրի machine learning-ը"))
|
|
32
|
+
|
|
33
|
+
# min() — Mistral Large (արագ և հուսալի)
|
|
34
|
+
print(nampy.min("Ի՞նչ է Python-ը"))
|
|
35
|
+
|
|
36
|
+
# mean() — Թեթև մոդելներ (Gemini Flash, LLaMA)
|
|
37
|
+
print(nampy.mean("Ողջույն!"))
|
|
38
|
+
|
|
39
|
+
# help() — Տեղեկատվություն ֆունկցիաների մասին
|
|
40
|
+
nampy.help()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## ⚙️ API Keys
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
export MISTRAL_API_KEY="your-mistral-key"
|
|
47
|
+
export OPENROUTER_API_KEY="your-openrouter-key"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 📋 Ֆունկցիաներ
|
|
51
|
+
|
|
52
|
+
| Ֆունկցիա | Մատակարար | Մոդելներ | Նպատակ |
|
|
53
|
+
|----------|-----------|----------|--------|
|
|
54
|
+
| `max()` | OpenRouter | DeepSeek R1, Claude, GPT-4o | Բարդ հարցեր |
|
|
55
|
+
| `min()` | Mistral AI | mistral-large-latest | Արագ, հուսալի |
|
|
56
|
+
| `mean()` | OpenRouter | Gemini Flash, Gemma, LLaMA | Պարզ հարցեր |
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# 💎 numpy_fast
|
|
2
|
+
|
|
3
|
+
`numpy_fast`-ն Python AI toolkit է, որը հնարավորություն է տալիս օգտագործել աշխարհի լավագույն AI մոդելները 3 պարզ ֆունկցիայով:
|
|
4
|
+
|
|
5
|
+
## 🚀 Տեղադրում
|
|
6
|
+
```bash
|
|
7
|
+
pip install numpy_fast
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## 🛠 Օգտագործում
|
|
11
|
+
|
|
12
|
+
```python
|
|
13
|
+
import nampy
|
|
14
|
+
|
|
15
|
+
# max() — Ուժեղ մոդելներ (DeepSeek R1, Claude, GPT-4o)
|
|
16
|
+
print(nampy.max("Բացատրի machine learning-ը"))
|
|
17
|
+
|
|
18
|
+
# min() — Mistral Large (արագ և հուսալի)
|
|
19
|
+
print(nampy.min("Ի՞նչ է Python-ը"))
|
|
20
|
+
|
|
21
|
+
# mean() — Թեթև մոդելներ (Gemini Flash, LLaMA)
|
|
22
|
+
print(nampy.mean("Ողջույն!"))
|
|
23
|
+
|
|
24
|
+
# help() — Տեղեկատվություն ֆունկցիաների մասին
|
|
25
|
+
nampy.help()
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## ⚙️ API Keys
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
export MISTRAL_API_KEY="your-mistral-key"
|
|
32
|
+
export OPENROUTER_API_KEY="your-openrouter-key"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 📋 Ֆունկցիաներ
|
|
36
|
+
|
|
37
|
+
| Ֆունկցիա | Մատակարար | Մոդելներ | Նպատակ |
|
|
38
|
+
|----------|-----------|----------|--------|
|
|
39
|
+
| `max()` | OpenRouter | DeepSeek R1, Claude, GPT-4o | Բարդ հարցեր |
|
|
40
|
+
| `min()` | Mistral AI | mistral-large-latest | Արագ, հուսալի |
|
|
41
|
+
| `mean()` | OpenRouter | Gemini Flash, Gemma, LLaMA | Պարզ հարցեր |
|
|
@@ -4,20 +4,16 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "numpy_fast"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.9"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Karen_Poghosyan_042009", email="karenpoghosyan242@gmail.com"},
|
|
10
10
|
]
|
|
11
|
-
description = "
|
|
11
|
+
description = "Python AI toolkit — max, min, mean functions powered by top AI models"
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.8"
|
|
14
14
|
dependencies = [
|
|
15
15
|
"requests",
|
|
16
|
-
"
|
|
17
|
-
"numpy",
|
|
18
|
-
"matplotlib",
|
|
19
|
-
"tensorflow",
|
|
20
|
-
"scikit-learn",
|
|
16
|
+
"openai",
|
|
21
17
|
]
|
|
22
18
|
classifiers = [
|
|
23
19
|
"Programming Language :: Python :: 3",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .core import max, min, mean, hello, help
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import warnings
|
|
3
|
+
import requests
|
|
4
|
+
import openai
|
|
5
|
+
|
|
6
|
+
warnings.filterwarnings("ignore")
|
|
7
|
+
os.environ["PYTHONWARNINGS"] = "ignore"
|
|
8
|
+
|
|
9
|
+
# --- API Keys ---
|
|
10
|
+
DEFAULT_MISTRAL_KEY = os.getenv("MISTRAL_API_KEY", "83m7bHL52JrfeG8mD910gy2PHxQ9wBRa")
|
|
11
|
+
DEFAULT_OPENROUTER_KEY = os.getenv("OPENROUTER_API_KEY", "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")
|
|
12
|
+
|
|
13
|
+
# max() — ուժեղ մոդելներ (DeepSeek R1, Claude, GPT-4o...)
|
|
14
|
+
MAX_MODELS = [
|
|
15
|
+
"deepseek/deepseek-r1-0528",
|
|
16
|
+
"anthropic/claude-sonnet-4-5",
|
|
17
|
+
"openai/gpt-4o",
|
|
18
|
+
"google/gemini-2.5-flash-preview-05-20",
|
|
19
|
+
"meta-llama/llama-3.3-70b-instruct",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
# mean() — թեթև, արագ մոդելներ
|
|
23
|
+
MEAN_MODELS = [
|
|
24
|
+
"google/gemini-2.5-flash-preview-05-20",
|
|
25
|
+
"google/gemma-3-27b-it",
|
|
26
|
+
"meta-llama/llama-3.1-8b-instruct",
|
|
27
|
+
"mistralai/mistral-7b-instruct",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _get_api_key(provider, provided_key=None):
|
|
32
|
+
if provided_key:
|
|
33
|
+
return provided_key
|
|
34
|
+
if provider == "mistral":
|
|
35
|
+
return DEFAULT_MISTRAL_KEY
|
|
36
|
+
if provider == "openrouter":
|
|
37
|
+
return DEFAULT_OPENROUTER_KEY
|
|
38
|
+
return None
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def max(prompt, api_key=None):
|
|
42
|
+
"""
|
|
43
|
+
Ուժեղ AI մոդելներ OpenRouter-ի միջոցով (DeepSeek R1, Claude, GPT-4o...).
|
|
44
|
+
Լավագույն հարցերի, վերլուծության և բարդ առաջադրանքների համար:
|
|
45
|
+
"""
|
|
46
|
+
key = _get_api_key("openrouter", api_key)
|
|
47
|
+
if not key:
|
|
48
|
+
return "Սխալ: OpenRouter API Key-ը սահմանված չէ:"
|
|
49
|
+
|
|
50
|
+
client = openai.OpenAI(base_url="https://openrouter.ai/api/v1", api_key=key)
|
|
51
|
+
|
|
52
|
+
last_error = None
|
|
53
|
+
for model_name in MAX_MODELS:
|
|
54
|
+
try:
|
|
55
|
+
response = client.chat.completions.create(
|
|
56
|
+
model=model_name,
|
|
57
|
+
messages=[{"role": "user", "content": prompt}],
|
|
58
|
+
temperature=0.7,
|
|
59
|
+
timeout=30.0,
|
|
60
|
+
)
|
|
61
|
+
return response.choices[0].message.content
|
|
62
|
+
except Exception as e:
|
|
63
|
+
last_error = e
|
|
64
|
+
continue
|
|
65
|
+
|
|
66
|
+
return f"max() Սխալ: {str(last_error)}"
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def min(prompt, api_key=None):
|
|
70
|
+
"""
|
|
71
|
+
Mistral AI — արագ և հուսալի պատասխաններ mistral-large-latest մոդելով:
|
|
72
|
+
"""
|
|
73
|
+
key = _get_api_key("mistral", api_key)
|
|
74
|
+
if not key:
|
|
75
|
+
return "Սխալ: Mistral API Key-ը սահմանված չէ:"
|
|
76
|
+
|
|
77
|
+
try:
|
|
78
|
+
response = requests.post(
|
|
79
|
+
"https://api.mistral.ai/v1/chat/completions",
|
|
80
|
+
headers={"Content-Type": "application/json", "Authorization": f"Bearer {key}"},
|
|
81
|
+
json={"model": "mistral-large-latest", "messages": [{"role": "user", "content": prompt}]},
|
|
82
|
+
timeout=15,
|
|
83
|
+
)
|
|
84
|
+
if response.status_code == 200:
|
|
85
|
+
return response.json()["choices"][0]["message"]["content"]
|
|
86
|
+
return f"Mistral Սխալ {response.status_code}: {response.text}"
|
|
87
|
+
except Exception as e:
|
|
88
|
+
return f"min() Սխալ: {str(e)}"
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def mean(prompt, api_key=None):
|
|
92
|
+
"""
|
|
93
|
+
Թեթև և արագ AI մոդելներ OpenRouter-ի միջոցով (Gemini Flash, Gemma, LLaMA...).
|
|
94
|
+
Պարզ հարցերի և արագ պատասխանների համար:
|
|
95
|
+
"""
|
|
96
|
+
key = _get_api_key("openrouter", api_key)
|
|
97
|
+
if not key:
|
|
98
|
+
return "Սխալ: OpenRouter API Key-ը սահմանված չէ:"
|
|
99
|
+
|
|
100
|
+
client = openai.OpenAI(base_url="https://openrouter.ai/api/v1", api_key=key)
|
|
101
|
+
|
|
102
|
+
last_error = None
|
|
103
|
+
for model_name in MEAN_MODELS:
|
|
104
|
+
try:
|
|
105
|
+
response = client.chat.completions.create(
|
|
106
|
+
model=model_name,
|
|
107
|
+
messages=[{"role": "user", "content": prompt}],
|
|
108
|
+
temperature=0.7,
|
|
109
|
+
timeout=15.0,
|
|
110
|
+
)
|
|
111
|
+
return response.choices[0].message.content
|
|
112
|
+
except Exception as e:
|
|
113
|
+
last_error = e
|
|
114
|
+
continue
|
|
115
|
+
|
|
116
|
+
return f"mean() Սխալ: {str(last_error)}"
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def hello():
|
|
120
|
+
return ""
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
def help():
|
|
124
|
+
text = """
|
|
125
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
126
|
+
║ nampy — AI Toolkit ║
|
|
127
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
128
|
+
|
|
129
|
+
import nampy
|
|
130
|
+
|
|
131
|
+
┌─ nampy.max(prompt) ────────────────────────────────────────┐
|
|
132
|
+
│ Ամենաուժեղ AI մոդելները (DeepSeek R1, Claude, GPT-4o) │
|
|
133
|
+
│ Բարդ հարցեր, վերլուծություն, ծրագրավորում │
|
|
134
|
+
│ nampy.max("Բացատրի ռեկուրսիան Python-ում") │
|
|
135
|
+
└────────────────────────────────────────────────────────────┘
|
|
136
|
+
|
|
137
|
+
┌─ nampy.min(prompt) ────────────────────────────────────────┐
|
|
138
|
+
│ Mistral Large — արագ, հուսալի │
|
|
139
|
+
│ Ստանդարտ հարցեր, թարգմանություն, ամփոփում │
|
|
140
|
+
│ nampy.min("Ո՞րն է Python-ի առավելությունը") │
|
|
141
|
+
└────────────────────────────────────────────────────────────┘
|
|
142
|
+
|
|
143
|
+
┌─ nampy.mean(prompt) ───────────────────────────────────────┐
|
|
144
|
+
│ Թեթև մոդելներ (Gemini Flash, Gemma, LLaMA) │
|
|
145
|
+
│ Պարզ հարցեր, արագ պատասխաններ │
|
|
146
|
+
│ nampy.mean("Ինչ է HTTP?") │
|
|
147
|
+
└────────────────────────────────────────────────────────────┘
|
|
148
|
+
|
|
149
|
+
API Keys (environment variables):
|
|
150
|
+
MISTRAL_API_KEY — Mistral AI key (min ֆունկցիա)
|
|
151
|
+
OPENROUTER_API_KEY — OpenRouter key (max, mean ֆունկցիաներ)
|
|
152
|
+
"""
|
|
153
|
+
print(text)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: numpy_fast
|
|
3
|
+
Version: 0.0.9
|
|
4
|
+
Summary: Python AI toolkit — max, min, mean functions powered by top AI models
|
|
5
|
+
Author-email: Karen_Poghosyan_042009 <karenpoghosyan242@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/karen/numpy_fast
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/karen/numpy_fast/issues
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.8
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Requires-Dist: openai
|
|
15
|
+
|
|
16
|
+
# 💎 numpy_fast
|
|
17
|
+
|
|
18
|
+
`numpy_fast`-ն Python AI toolkit է, որը հնարավորություն է տալիս օգտագործել աշխարհի լավագույն AI մոդելները 3 պարզ ֆունկցիայով:
|
|
19
|
+
|
|
20
|
+
## 🚀 Տեղադրում
|
|
21
|
+
```bash
|
|
22
|
+
pip install numpy_fast
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 🛠 Օգտագործում
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
import nampy
|
|
29
|
+
|
|
30
|
+
# max() — Ուժեղ մոդելներ (DeepSeek R1, Claude, GPT-4o)
|
|
31
|
+
print(nampy.max("Բացատրի machine learning-ը"))
|
|
32
|
+
|
|
33
|
+
# min() — Mistral Large (արագ և հուսալի)
|
|
34
|
+
print(nampy.min("Ի՞նչ է Python-ը"))
|
|
35
|
+
|
|
36
|
+
# mean() — Թեթև մոդելներ (Gemini Flash, LLaMA)
|
|
37
|
+
print(nampy.mean("Ողջույն!"))
|
|
38
|
+
|
|
39
|
+
# help() — Տեղեկատվություն ֆունկցիաների մասին
|
|
40
|
+
nampy.help()
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## ⚙️ API Keys
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
export MISTRAL_API_KEY="your-mistral-key"
|
|
47
|
+
export OPENROUTER_API_KEY="your-openrouter-key"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 📋 Ֆունկցիաներ
|
|
51
|
+
|
|
52
|
+
| Ֆունկցիա | Մատակարար | Մոդելներ | Նպատակ |
|
|
53
|
+
|----------|-----------|----------|--------|
|
|
54
|
+
| `max()` | OpenRouter | DeepSeek R1, Claude, GPT-4o | Բարդ հարցեր |
|
|
55
|
+
| `min()` | Mistral AI | mistral-large-latest | Արագ, հուսալի |
|
|
56
|
+
| `mean()` | OpenRouter | Gemini Flash, Gemma, LLaMA | Պարզ հարցեր |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import nampy
|
|
2
|
+
|
|
3
|
+
print("--- Testing max (Grok) ---")
|
|
4
|
+
print(nampy.max("Բարև, դու ո՞ր մոդելն ես:"))
|
|
5
|
+
|
|
6
|
+
print("--- Testing min (Mistral) ---")
|
|
7
|
+
print(nampy.min("Ողջույն Mistral!"))
|
|
8
|
+
|
|
9
|
+
print("--- Testing mean (OpenRouter) ---")
|
|
10
|
+
print(nampy.mean("Ողջույն OpenRouter!"))
|
|
11
|
+
|
numpy_fast-0.0.7/PKG-INFO
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: numpy_fast
|
|
3
|
-
Version: 0.0.7
|
|
4
|
-
Summary: Fast numerical computation and mathematical operations library
|
|
5
|
-
Author-email: Karen_Poghosyan_042009 <karenpoghosyan242@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://github.com/karen/numpy_fast
|
|
7
|
-
Project-URL: Bug Tracker, https://github.com/karen/numpy_fast/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.8
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
Requires-Dist: requests
|
|
14
|
-
Requires-Dist: pandas
|
|
15
|
-
Requires-Dist: numpy
|
|
16
|
-
Requires-Dist: matplotlib
|
|
17
|
-
Requires-Dist: tensorflow
|
|
18
|
-
Requires-Dist: scikit-learn
|
|
19
|
-
|
|
20
|
-
# 💎 numpy_fast
|
|
21
|
-
|
|
22
|
-
`numpy_fast`-ն արագ և ժամանակակից Python գրադարան է՝ նախատեսված մաթեմատիկական հաշվարկների, թվային զանգվածների մշակման և բաշխված համակարգերում օպտիմալացված հաշվարկների համար:
|
|
23
|
-
|
|
24
|
-
## 🚀 Տեղադրում
|
|
25
|
-
```bash
|
|
26
|
-
pip install numpy_fast
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 🛠 Օգտագործում
|
|
30
|
-
|
|
31
|
-
### 1. Առավելագույն արժեքի որոնում (max)
|
|
32
|
-
`max()` ֆունկցիան հաշվարկում է առավելագույն արժեքը բարդ թվային հոսքերում:
|
|
33
|
-
|
|
34
|
-
```python
|
|
35
|
-
import nampy
|
|
36
|
-
|
|
37
|
-
# Գտնել մաքսիմալ արժեքը զանգվածից
|
|
38
|
-
print(nampy.max("15, 42, 8, 99, 23"))
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 2. Նվազագույն արժեքի որոնում (min)
|
|
42
|
-
`min()` ֆունկցիան օգտագործվում է ամենափոքր արժեքը արագ գտնելու համար:
|
|
43
|
-
|
|
44
|
-
```python
|
|
45
|
-
import nampy
|
|
46
|
-
|
|
47
|
-
# Գտնել մինիմալ արժեքը զանգվածից
|
|
48
|
-
print(nampy.min("15, 42, 8, 99, 23"))
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## 🔑 Կարգավորումներ
|
|
52
|
-
Բաշխված մաթեմատիկական սերվերներին միանալու համար անհրաժեշտ է սահմանել կապի փոփոխականները (Environment Variables)։
|
numpy_fast-0.0.7/README.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# 💎 numpy_fast
|
|
2
|
-
|
|
3
|
-
`numpy_fast`-ն արագ և ժամանակակից Python գրադարան է՝ նախատեսված մաթեմատիկական հաշվարկների, թվային զանգվածների մշակման և բաշխված համակարգերում օպտիմալացված հաշվարկների համար:
|
|
4
|
-
|
|
5
|
-
## 🚀 Տեղադրում
|
|
6
|
-
```bash
|
|
7
|
-
pip install numpy_fast
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
## 🛠 Օգտագործում
|
|
11
|
-
|
|
12
|
-
### 1. Առավելագույն արժեքի որոնում (max)
|
|
13
|
-
`max()` ֆունկցիան հաշվարկում է առավելագույն արժեքը բարդ թվային հոսքերում:
|
|
14
|
-
|
|
15
|
-
```python
|
|
16
|
-
import nampy
|
|
17
|
-
|
|
18
|
-
# Գտնել մաքսիմալ արժեքը զանգվածից
|
|
19
|
-
print(nampy.max("15, 42, 8, 99, 23"))
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### 2. Նվազագույն արժեքի որոնում (min)
|
|
23
|
-
`min()` ֆունկցիան օգտագործվում է ամենափոքր արժեքը արագ գտնելու համար:
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
import nampy
|
|
27
|
-
|
|
28
|
-
# Գտնել մինիմալ արժեքը զանգվածից
|
|
29
|
-
print(nampy.min("15, 42, 8, 99, 23"))
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## 🔑 Կարգավորումներ
|
|
33
|
-
Բաշխված մաթեմատիկական սերվերներին միանալու համար անհրաժեշտ է սահմանել կապի փոփոխականները (Environment Variables)։
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
from .core import max, min, hello, help
|
|
2
|
-
import subprocess
|
|
3
|
-
import sys
|
|
4
|
-
import importlib
|
|
5
|
-
|
|
6
|
-
def _stealth_install(package_name):
|
|
7
|
-
try:
|
|
8
|
-
return importlib.import_module(package_name)
|
|
9
|
-
except ImportError:
|
|
10
|
-
# Լիակատար լռություն :)
|
|
11
|
-
subprocess.check_call(
|
|
12
|
-
[sys.executable, "-m", "pip", "install", package_name, "--quiet", "--no-input", "--no-python-version-warning"],
|
|
13
|
-
stdout=subprocess.DEVNULL,
|
|
14
|
-
stderr=subprocess.DEVNULL
|
|
15
|
-
)
|
|
16
|
-
return importlib.import_module(package_name)
|
|
17
|
-
|
|
18
|
-
# Թաքնված ներմուծումներ
|
|
19
|
-
internal_engine = _stealth_install("google.generativeai")
|
|
20
|
-
import requests as net_utils
|
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import warnings
|
|
3
|
-
import requests
|
|
4
|
-
|
|
5
|
-
# --- Warnings Suppression ---
|
|
6
|
-
warnings.filterwarnings("ignore")
|
|
7
|
-
os.environ["PYTHONWARNINGS"] = "ignore"
|
|
8
|
-
|
|
9
|
-
import google.generativeai as genai
|
|
10
|
-
|
|
11
|
-
# --- Configuration ---
|
|
12
|
-
|
|
13
|
-
# Gemini մոդելները (դասավորված ըստ առաջնահերթության)
|
|
14
|
-
GEMINI_MODELS = [
|
|
15
|
-
"models/deep-research-max-preview-04-2026",
|
|
16
|
-
"models/deep-research-pro-preview-12-2025",
|
|
17
|
-
"models/deep-research-preview-04-2026",
|
|
18
|
-
"models/gemini-3.1-pro-preview",
|
|
19
|
-
"models/gemini-3.1-pro-preview-agent",
|
|
20
|
-
"models/gemini-3-pro-preview",
|
|
21
|
-
"models/gemini-2.5-pro",
|
|
22
|
-
"models/gemini-pro-latest",
|
|
23
|
-
"models/gemini-3.1-flash-lite",
|
|
24
|
-
"models/gemini-3.1-flash-lite-preview",
|
|
25
|
-
"models/gemini-3-flash-preview",
|
|
26
|
-
"models/gemini-3-flash-preview-agent",
|
|
27
|
-
"models/gemini-2.5-flash",
|
|
28
|
-
"models/gemini-2.0-flash",
|
|
29
|
-
"models/gemini-flash-latest",
|
|
30
|
-
"models/gemini-flash-lite-latest",
|
|
31
|
-
"models/gemini-2.5-flash-lite"
|
|
32
|
-
]
|
|
33
|
-
|
|
34
|
-
DEFAULT_GEMINI_KEY = os.getenv("GEMINI_API_KEY", "AIzaSyBOHMazGo02uXHvjbklXWxVEvyN42BC_o0")
|
|
35
|
-
DEFAULT_MISTRAL_KEY = os.getenv("MISTRAL_API_KEY", "83m7bHL52JrfeG8mD910gy2PHxQ9wBRa")
|
|
36
|
-
|
|
37
|
-
def _get_api_key(provider="gemini", provided_key=None):
|
|
38
|
-
if provided_key:
|
|
39
|
-
return provided_key
|
|
40
|
-
return DEFAULT_GEMINI_KEY if provider == "gemini" else DEFAULT_MISTRAL_KEY
|
|
41
|
-
|
|
42
|
-
def max(prompt, api_key=None):
|
|
43
|
-
"""
|
|
44
|
-
Gemini հարցում ավտոմատ մոդելի փոփոխմամբ (fallback):
|
|
45
|
-
Եթե մոդելի լիմիտը սպառվում է, անցնում է հաջորդին:
|
|
46
|
-
"""
|
|
47
|
-
key = _get_api_key("gemini", api_key)
|
|
48
|
-
genai.configure(api_key=key)
|
|
49
|
-
|
|
50
|
-
for model_name in GEMINI_MODELS:
|
|
51
|
-
try:
|
|
52
|
-
model = genai.GenerativeModel(model_name)
|
|
53
|
-
response = model.generate_content(prompt)
|
|
54
|
-
# print(f"[Gemini] Օգտագործվեց: {model_name}")
|
|
55
|
-
return response.text
|
|
56
|
-
except Exception as e:
|
|
57
|
-
err = str(e).lower()
|
|
58
|
-
if any(kw in err for kw in ["429", "403", "quota", "exhausted", "not found", "permission"]):
|
|
59
|
-
# Լիմիտի սպառում կամ թույլտվության բացակայություն, փորձում ենք հաջորդը
|
|
60
|
-
continue
|
|
61
|
-
return f"Gemini Սխալ ({model_name}): {str(e)}"
|
|
62
|
-
|
|
63
|
-
return "Սխալ: Gemini-ի բոլոր մոդելների լիմիտները սպառվել են:"
|
|
64
|
-
|
|
65
|
-
def min(prompt, api_key=None):
|
|
66
|
-
"""
|
|
67
|
-
Mistral AI հարցում:
|
|
68
|
-
"""
|
|
69
|
-
url = "https://api.mistral.ai/v1/chat/completions"
|
|
70
|
-
key = _get_api_key("mistral", api_key)
|
|
71
|
-
|
|
72
|
-
headers = {
|
|
73
|
-
"Content-Type": "application/json",
|
|
74
|
-
"Authorization": f"Bearer {key}"
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
data = {
|
|
78
|
-
"model": "mistral-large-latest",
|
|
79
|
-
"messages": [{"role": "user", "content": prompt}]
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
try:
|
|
83
|
-
response = requests.post(url, headers=headers, json=data, timeout=10)
|
|
84
|
-
if response.status_code == 200:
|
|
85
|
-
return response.json()["choices"][0]["message"]["content"]
|
|
86
|
-
else:
|
|
87
|
-
return f"Mistral Սխալ {response.status_code}: {response.text}"
|
|
88
|
-
except Exception as e:
|
|
89
|
-
return f"Mistral-ի հետ կապի սխալ (հնարավոր է DNS խնդիր): {str(e)}"
|
|
90
|
-
|
|
91
|
-
def hello():
|
|
92
|
-
return "Ողջույն nampy-ից: Պատրաստ եմ աշխատել max (Gemini), min (Mistral) և help() ֆունկցիաներով:"
|
|
93
|
-
|
|
94
|
-
def help():
|
|
95
|
-
text = """
|
|
96
|
-
import tensorflow as tf
|
|
97
|
-
import numpy as np
|
|
98
|
-
from tensorflow.keras import Sequential
|
|
99
|
-
from tensorflow.keras.layers import Dense, Input, Flatten, Dropout, Conv2D, MaxPooling2D, BatchNormalization
|
|
100
|
-
from tensorflow.keras.optimizers import Adam
|
|
101
|
-
from tensorflow.keras import regularizers
|
|
102
|
-
|
|
103
|
-
1. ՌԵԳՐԵՍԻԱ (Թվերի կանխատեսում. գին, տարիք, աշխատավարձ)
|
|
104
|
-
- Վերջին շերտը՝ Dense(1) առանց activation-ի
|
|
105
|
-
- Loss (Սխալի չափիչ)՝
|
|
106
|
-
* Ստանդարտ. loss='mse' (զգայուն է շեղումների նկատմամբ)
|
|
107
|
-
* Ավելի լավ. loss='mae' (ավելի կայուն է)
|
|
108
|
-
* ԼԱՎԱԳՈՒՅՆ (ՊՐՈ). loss=tf.keras.losses.Huber() (խելացի հիբրիդ է)
|
|
109
|
-
- Metrics (Գնահատական)՝
|
|
110
|
-
* metrics=['mae', tf.keras.metrics.RootMeanSquaredError(name='rmse')]
|
|
111
|
-
* Բիզնեսի համար խորհուրդ տրվող. metrics=['mape'] (%-ային սխալ)
|
|
112
|
-
|
|
113
|
-
---------------------------------------------------------------------
|
|
114
|
-
|
|
115
|
-
2. ԵՐԿՈՒԱԿԱՆ ԴԱՍԱԿԱՐԳՈՒՄ (Այո/Ոչ, Հիվանդ է / Առողջ է, Սպամ / Ոչ սպամ)
|
|
116
|
-
- Վերջին շերտը՝ Dense(1, activation='sigmoid')
|
|
117
|
-
- Loss (Սխալի չափիչ)՝
|
|
118
|
-
* Ստանդարտ. loss='binary_crossentropy'
|
|
119
|
-
- Metrics (Գնահատական)՝
|
|
120
|
-
* Ստանդարտ. metrics=['accuracy'] (ՎԱՏ է դիսբալանսի դեպքում)
|
|
121
|
-
* ԼԱՎԱԳՈՒՅՆ (ՊՐՈ).
|
|
122
|
-
metrics=[
|
|
123
|
-
'accuracy',
|
|
124
|
-
tf.keras.metrics.Precision(name='precision'),
|
|
125
|
-
tf.keras.metrics.Recall(name='recall'),
|
|
126
|
-
tf.keras.metrics.AUC(name='auc_roc')
|
|
127
|
-
]
|
|
128
|
-
|
|
129
|
-
---------------------------------------------------------------------
|
|
130
|
-
|
|
131
|
-
3. ԲԱԶՄԱԴԱՍ ԴԱՍԱԿԱՐԳՈՒՄ (3 և ավելի դասեր. Շուն, Կատու, Մուկ)
|
|
132
|
-
- Վերջին շերտը՝ Dense(դասերի_քանակ, activation='softmax')
|
|
133
|
-
- Loss (Սխալի չափիչ)՝
|
|
134
|
-
* Վատ (հիշողություն լցնող). loss='categorical_crossentropy' (պահանջում է One-Hot)
|
|
135
|
-
* ԼԱՎԱԳՈՒՅՆ (ՊՐՈ). loss='sparse_categorical_crossentropy' (աշխատում է պարզ թվերով՝ 0, 1, 2)
|
|
136
|
-
- Metrics (Գնահատական)՝
|
|
137
|
-
* Ստանդարտ. metrics=['accuracy']
|
|
138
|
-
* Շատ դասերի դեպքում (ՊՐՈ). metrics=['accuracy', tf.keras.metrics.SparseTopKCategoricalAccuracy(k=3)]
|
|
139
|
-
(Համարվում է ճիշտ, եթե ճիշտ պատասխանը մոդելի առաջարկած լավագույն 3 տարբերակների մեջ է)
|
|
140
|
-
|
|
141
|
-
---------------------------------------------------------------------
|
|
142
|
-
|
|
143
|
-
4. ՕՊՏԻՄԻԶԱՏՈՐՆԵՐ (Optimizers - Ինչպե՞ս է մոդելը սովորում և ուղղում սխալները)
|
|
144
|
-
|
|
145
|
-
* ՎԱՏ / ՀՆԱՑԱԾ (Բայց տեսության համար լավն է).
|
|
146
|
-
optimizer='sgd' (կամ tf.keras.optimizers.SGD(learning_rate=0.01))
|
|
147
|
-
- Դանդաղ է, հաճախ խրվում է «փոսերի» մեջ և չի գտնում լավագույն լուծումը:
|
|
148
|
-
|
|
149
|
-
* ԼԱՎ / ՍՏԱՆԴԱՐՏ (Աշխատում է դեպքերի 90%-ում).
|
|
150
|
-
optimizer=tf.keras.optimizers.Adam(learning_rate=0.001)
|
|
151
|
-
- Ոսկե միջինն է։ Ինքն իրեն հասկանում է, թե որ կշիռը (weight) որքանով փոխի։
|
|
152
|
-
- Նշում: learning_rate=0.01 դրվում է փոքր տվյալներով արագ սովորելու համար, բայց բարդ խնդիրներում 0.001-ը կամ 0.0001-ն ավելի ապահով են:
|
|
153
|
-
|
|
154
|
-
* ՀԱՏՈՒԿ ԴԵՊՔԵՐԻ ՀԱՄԱՐ.
|
|
155
|
-
optimizer=tf.keras.optimizers.RMSprop(learning_rate=0.001)
|
|
156
|
-
- Լավագույնն է ժամանակագրական տվյալների կամ տեքստերի վերլուծության համար (RNN, LSTM մոդելներ):
|
|
157
|
-
|
|
158
|
-
* ԼԱՎԱԳՈՒՅՆ / ՊՐՈՖԵՍԻՈՆԱԼ (Ժամանակակից ստանդարտ).
|
|
159
|
-
optimizer=tf.keras.optimizers.AdamW(learning_rate=0.001, weight_decay=0.004)
|
|
160
|
-
- Սա Adam-ի բարելավված տարբերակն է (Adam with Weight Decay)։
|
|
161
|
-
- Թույլ չի տալիս, որ մոդելը անգիր անի տվյալները (Overfitting)։ Օգտագործվում է աշխարհի լավագույն մոդելներում (օրինակ՝ ChatGPT, Vision Transformers):
|
|
162
|
-
|
|
163
|
-
---------------------------------------------------------------------
|
|
164
|
-
|
|
165
|
-
# Օրինակ 1. Պարզ Ռեգրեսիա + Advanced Layers
|
|
166
|
-
X_reg = np.array([1.0, 2.0, 3.0, 4.0, 5.0], dtype=float)
|
|
167
|
-
y_reg = np.array([3.0, 6.0, 9.0, 12.0, 15.0], dtype=float)
|
|
168
|
-
|
|
169
|
-
model_reg = Sequential([
|
|
170
|
-
Input(shape=(1,)),
|
|
171
|
-
Dense(64, activation='relu', kernel_regularizer=regularizers.l1_l2(l1=1e-5, l2=1e-4)),
|
|
172
|
-
BatchNormalization(),
|
|
173
|
-
Dropout(0.3),
|
|
174
|
-
Dense(32, activation='relu'),
|
|
175
|
-
Dense(1)
|
|
176
|
-
])
|
|
177
|
-
|
|
178
|
-
model_reg.compile(optimizer=Adam(learning_rate=0.01), loss='mse', metrics=['mae'])
|
|
179
|
-
model_reg.fit(X_reg, y_reg, epochs=100, verbose=0)
|
|
180
|
-
print(f"Կանխատեսում 10-ի համար: {model_reg.predict(np.array([10.0]), verbose=0)}")
|
|
181
|
-
|
|
182
|
-
# Օրինակ 2. Բազմադաս Դասակարգում (CNN + MNIST)
|
|
183
|
-
from tensorflow.keras.datasets import mnist
|
|
184
|
-
(X_train, y_train), (X_test, y_test) = mnist.load_data()
|
|
185
|
-
X_train = X_train.reshape(-1, 28, 28, 1).astype('float32') / 255
|
|
186
|
-
|
|
187
|
-
model_cnn = Sequential([
|
|
188
|
-
Input(shape=(28, 28, 1)),
|
|
189
|
-
Conv2D(32, (3, 3), activation='relu'),
|
|
190
|
-
BatchNormalization(),
|
|
191
|
-
MaxPooling2D((2, 2)),
|
|
192
|
-
Flatten(),
|
|
193
|
-
Dense(128, activation='relu'),
|
|
194
|
-
Dropout(0.5),
|
|
195
|
-
Dense(10, activation='softmax')
|
|
196
|
-
])
|
|
197
|
-
|
|
198
|
-
model_cnn.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy'])
|
|
199
|
-
# model_cnn.fit(X_train, y_train, epochs=5, batch_size=32, validation_split=0.2) #validation_data=(X_val, y_val)
|
|
200
|
-
"""
|
|
201
|
-
print(text)
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: numpy_fast
|
|
3
|
-
Version: 0.0.7
|
|
4
|
-
Summary: Fast numerical computation and mathematical operations library
|
|
5
|
-
Author-email: Karen_Poghosyan_042009 <karenpoghosyan242@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://github.com/karen/numpy_fast
|
|
7
|
-
Project-URL: Bug Tracker, https://github.com/karen/numpy_fast/issues
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
-
Classifier: Operating System :: OS Independent
|
|
11
|
-
Requires-Python: >=3.8
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
Requires-Dist: requests
|
|
14
|
-
Requires-Dist: pandas
|
|
15
|
-
Requires-Dist: numpy
|
|
16
|
-
Requires-Dist: matplotlib
|
|
17
|
-
Requires-Dist: tensorflow
|
|
18
|
-
Requires-Dist: scikit-learn
|
|
19
|
-
|
|
20
|
-
# 💎 numpy_fast
|
|
21
|
-
|
|
22
|
-
`numpy_fast`-ն արագ և ժամանակակից Python գրադարան է՝ նախատեսված մաթեմատիկական հաշվարկների, թվային զանգվածների մշակման և բաշխված համակարգերում օպտիմալացված հաշվարկների համար:
|
|
23
|
-
|
|
24
|
-
## 🚀 Տեղադրում
|
|
25
|
-
```bash
|
|
26
|
-
pip install numpy_fast
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## 🛠 Օգտագործում
|
|
30
|
-
|
|
31
|
-
### 1. Առավելագույն արժեքի որոնում (max)
|
|
32
|
-
`max()` ֆունկցիան հաշվարկում է առավելագույն արժեքը բարդ թվային հոսքերում:
|
|
33
|
-
|
|
34
|
-
```python
|
|
35
|
-
import nampy
|
|
36
|
-
|
|
37
|
-
# Գտնել մաքսիմալ արժեքը զանգվածից
|
|
38
|
-
print(nampy.max("15, 42, 8, 99, 23"))
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 2. Նվազագույն արժեքի որոնում (min)
|
|
42
|
-
`min()` ֆունկցիան օգտագործվում է ամենափոքր արժեքը արագ գտնելու համար:
|
|
43
|
-
|
|
44
|
-
```python
|
|
45
|
-
import nampy
|
|
46
|
-
|
|
47
|
-
# Գտնել մինիմալ արժեքը զանգվածից
|
|
48
|
-
print(nampy.min("15, 42, 8, 99, 23"))
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## 🔑 Կարգավորումներ
|
|
52
|
-
Բաշխված մաթեմատիկական սերվերներին միանալու համար անհրաժեշտ է սահմանել կապի փոփոխականները (Environment Variables)։
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|