فهرست منبع

Merge branch 'development' of github.com:visuddhinanda/mint into development

visuddhinanda 2 هفته پیش
والد
کامیت
5c5c33324a

+ 1 - 0
ai-translate/.gitignore

@@ -1,6 +1,7 @@
 /tmp/
 /config.toml
 
+/dist/
 __pycache__/
 ai_translate.egg-info/
 .stop

+ 3 - 0
ai-translate/README.md

@@ -1,6 +1,9 @@
 # Usage
 
 ```bash
+# disable gil ONLY for ubuntu
+$ export PYTHON_GIL=0
+
 # initial python3 virtual env folder
 $ python3 -m venv $HOME/tmp/python3
 # load virtual env vars

+ 4 - 6
ai-translate/pyproject.toml

@@ -1,11 +1,11 @@
 [build-system]
-requires = ["setuptools"]
-build-backend = "setuptools.build_meta"
+requires = ["hatchling >= 1.26"]
+build-backend = "hatchling.build"
 
 [project]
 name = "ai_translate"
-version = "2026.1.16"
-requires-python = ">= 3.12"
+version = "2026.6.28"
+requires-python = ">= 3.14"
 description = "An OpenAI consumer process"
 readme = "README.md"
 license = "MIT"
@@ -15,5 +15,3 @@ dependencies = ["pika", "requests", "redis[hiredis]", "openai"]
 [project.scripts]
 mint-ai-translate-consumer = "ai_translate.__main__:main"
 
-[tool.setuptools]
-py-modules = []

+ 12 - 10
api-v13/app/Console/Commands/ExportChannel.php

@@ -47,7 +47,7 @@ class ExportChannel extends Command
         if (\App\Tools\Tools::isStop()) {
             return 0;
         }
-        Log::debug('task export offline channel-table start');
+        $this->info('task export offline channel-table start');
         $exportFile = storage_path('app/public/export/offline/' . $this->argument('db') . '-' . date("Y-m-d") . '.db3');
         $dbh = new \PDO('sqlite:' . $exportFile, "", "", array(\PDO::ATTR_PERSISTENT => true));
         $dbh->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_WARNING);
@@ -62,10 +62,8 @@ class ExportChannel extends Command
             Log::error($e->getMessage(), ['exception' => $e]);
             return 1;
         }
-
-        $bar = $this->output->createProgressBar(Channel::where('status', 30)->count());
-        foreach (
-            Channel::where('status', 30)
+        $total = Channel::where('status', 30)->count();
+        $channels= Channel::where('status', 30)
                 ->select([
                     'uid',
                     'name',
@@ -76,8 +74,9 @@ class ExportChannel extends Command
                     'setting',
                     'created_at'
                 ])
-                ->cursor() as $row
-        ) {
+                ->cursor();
+
+        foreach ($channels as $key => $row  ) {
             $currData = array(
                 $row->uid,
                 $row->name,
@@ -89,11 +88,14 @@ class ExportChannel extends Command
                 $row->created_at,
             );
             $stmt->execute($currData);
-            $bar->advance();
+
+            if($key % 30 ===0){
+                $precent = (int)($key*100/$total);
+                $this->line("[{$precent}%]");
+            }
         }
         $dbh->commit();
-        $bar->finish();
-        Log::debug('task export offline channel-table finished');
+        $this->info('task export offline channel-table finished');
         return 0;
     }
 }

+ 3 - 6
api-v13/app/Console/Commands/ExportOffline.php

@@ -15,7 +15,7 @@ class ExportOffline extends Command
      * php artisan export:offline lzma
      * @var string
      */
-    protected $signature = 'export:offline {format?  : zip file format 7z,lzma,gz } {--shortcut}  {--driver=str}';
+    protected $signature = 'export:offline {format?  : zip file format 7z,lzma,gz } {--test}  {--driver=str}';
 
     /**
      * The console command description.
@@ -76,13 +76,11 @@ class ExportOffline extends Command
         $this->call('export:term');
 
         //导出channel
-        $this->info('export channel start');
         $this->call('export:channel', ['db' => 'wikipali-offline']);
         $this->call('export:channel', ['db' => 'wikipali-offline-index']);
 
-        if (!$this->option('shortcut')) {
+        if (!$this->option('test')) {
             //tag
-            $this->info('export tag start');
             $this->call('export:tag', ['db' => 'wikipali-offline']);
             $this->call('export:tag.map', ['db' => 'wikipali-offline']);
             //
@@ -100,8 +98,7 @@ class ExportOffline extends Command
             $this->call('export:sentence', ['--type' => 'original', '--driver' => $this->option('driver')]);
         }
 
-        $this->info('zip');
-        Log::info('export offline: db写入完毕 开始压缩');
+        $this->info('export offline: db写入完毕 开始压缩');
 
         sleep(5);
         $this->call('export:zip', [

+ 1 - 1
api-v13/app/Console/Commands/ExportTag.php

@@ -40,7 +40,7 @@ class ExportTag extends Command
      */
     public function handle()
     {
-        Log::debug('task: export offline data tag-table start');
+        $this->info('task: export offline data tag-table start');
         if (\App\Tools\Tools::isStop()) {
             return 0;
         }

+ 1 - 1
api-v13/app/Console/Commands/ExportTagmap.php

@@ -40,7 +40,7 @@ class ExportTagmap extends Command
      */
     public function handle()
     {
-        Log::debug('task: export offline tagmap-table start');
+        $this->info('task: export offline tagmap-table start');
         if (\App\Tools\Tools::isStop()) {
             return 0;
         }

+ 9 - 6
api-v13/app/Console/Commands/ExportTerm.php

@@ -65,9 +65,8 @@ class ExportTerm extends Command
             return 1;
         }
 
-        $bar = $this->output->createProgressBar(DhammaTerm::count());
-        foreach (
-            DhammaTerm::select([
+        $total = DhammaTerm::count();
+        $channels = DhammaTerm::select([
                 'guid',
                 'word',
                 'word_en',
@@ -83,8 +82,8 @@ class ExportTerm extends Command
                 "updated_at",
                 "deleted_at"
             ])
-                ->cursor() as $row
-        ) {
+                ->cursor();
+        foreach ($channels as $key => $row) {
             $currData = array(
                 $row->guid,
                 $row->word,
@@ -102,7 +101,11 @@ class ExportTerm extends Command
                 $row->deleted_at,
             );
             $stmt->execute($currData);
-            $bar->advance();
+            
+            if($key % 1000 ===0){
+                $precent = (int)($key*100/$total);
+                $this->line("[{$precent}%]");
+            }
         }
         $dbh->commit();
         $bar->finish();

+ 4 - 4
api-v13/app/Console/Commands/UpgradeAITranslation.php

@@ -146,7 +146,7 @@ class UpgradeAITranslation extends Command
         $cacheKey = self::CACHE_KEY_PREFIX.':'.$type.':'.$channelId;
 
         if ($this->option('fresh')) {
-            Cache::forget($cacheKey);
+            //Cache::forget($cacheKey);
             $this->info('Cleared cached cursor.');
         }
 
@@ -154,7 +154,7 @@ class UpgradeAITranslation extends Command
         $isFullRun = ! $this->option('book') && ! $this->option('para');
 
         // 从缓存恢复已完成的 (book, para) 集合,作为重入时的稳定游标
-        $done = Cache::get($cacheKey, []);
+        $done = [];// Cache::get($cacheKey, []);
 
         $books = [];
         if ($this->option('book')) {
@@ -209,7 +209,7 @@ class UpgradeAITranslation extends Command
                 $this->info($this->argument('type')." {$book}-{$paragraph} ".count($data).' sentences time='.$time);
                 // 该处理单元全部写库完成后再标记游标,确保中途中断不会误跳过
                 $done[$cursor] = true;
-                Cache::put($cacheKey, $done, now()->addHours(24));
+                //Cache::put($cacheKey, $done, now()->addHours(24));
             }
 
             $param = [
@@ -236,7 +236,7 @@ class UpgradeAITranslation extends Command
 
         // 完整遍历正常结束,清空断点缓存
         if ($isFullRun) {
-            Cache::forget($cacheKey);
+            //Cache::forget($cacheKey);
         }
 
         return 0;

+ 6 - 2
langchain-server/pyproject.toml

@@ -1,6 +1,10 @@
+[build-system]
+requires = ["hatchling >= 1.26"]
+build-backend = "hatchling.build"
+
 [project]
 name = "rhododendron"
-version = "2026.4.19"
+version = "2026.6.28"
 authors = [
     { name = "Visuddhinanda", email = "visuddhinanda@gmail.com" },
     { name = "Kassapa", email = "ven.kassapa@qq.com" },
@@ -20,4 +24,4 @@ Homepage = "https://github.com/iapt-platform/mint/tree/master/langchain-server"
 Issues = "https://github.com/iapt-platform/mint/issues"
 
 [project.scripts]
-rhododendron = "rhododendron:main_cli"
+rhododendron = "rhododendron.__main__:main"

+ 6 - 2
sutta-pitaka-importer/pyproject.toml

@@ -1,6 +1,10 @@
+[build-system]
+requires = ["hatchling >= 1.26"]
+build-backend = "hatchling.build"
+
 [project]
 name = "dahlia"
-version = "2026.5.8"
+version = "2026.6.28"
 authors = [
     { name = "Visuddhinanda", email = "visuddhinanda@gmail.com" },
     { name = "Kassapa", email = "ven.kassapa@qq.com" },
@@ -27,4 +31,4 @@ Homepage = "https://github.com/iapt-platform/mint/tree/master/sutta-pitaka-impor
 Issues = "https://github.com/iapt-platform/mint/issues"
 
 [project.scripts]
-dahlia = "dahlia:main"
+dahlia = "dahlia.__main__:main"