mirror of
https://github.com/stardrophere/InsightRadar.git
synced 2026-06-05 23:07:51 +08:00
修复前端无法编译的问题
This commit is contained in:
Binary file not shown.
@@ -1,27 +0,0 @@
|
||||
import os
|
||||
|
||||
|
||||
def print_tree(root, prefix=""):
|
||||
items = sorted(
|
||||
name for name in os.listdir(root)
|
||||
if name != "__pycache__"
|
||||
)
|
||||
total = len(items)
|
||||
|
||||
for i, name in enumerate(items):
|
||||
path = os.path.join(root, name)
|
||||
is_last = (i == total - 1)
|
||||
|
||||
connector = "└── " if is_last else "├── "
|
||||
print(prefix + connector + name)
|
||||
|
||||
if os.path.isdir(path):
|
||||
extension = " " if is_last else "│ "
|
||||
print_tree(path, prefix + extension)
|
||||
|
||||
|
||||
root_dir = r"E:\ScnuProject\InsightRadar\backend\app"
|
||||
print(os.path.basename(root_dir) + "/")
|
||||
print_tree(root_dir)
|
||||
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
# from dotenv import load_dotenv
|
||||
# import os
|
||||
# import time
|
||||
#
|
||||
# print("step 1: loading env")
|
||||
# load_dotenv()
|
||||
#
|
||||
# hf_token = os.getenv("HF_TOKEN")
|
||||
# print("step 2:", "HF_TOKEN loaded" if hf_token else "No token")
|
||||
#
|
||||
# print("step 3: importing sentence-transformers")
|
||||
# from sentence_transformers import SentenceTransformer
|
||||
#
|
||||
# print("step 4: start loading model")
|
||||
# t0 = time.time()
|
||||
# model = SentenceTransformer(r"E:\Models\bge-m3", local_files_only=True, device="cuda")
|
||||
# print(f"step 5: model loaded in {time.time() - t0:.2f}s")
|
||||
#
|
||||
# print("step 6: importing sklearn/numpy")
|
||||
# from sklearn.metrics.pairwise import cosine_similarity
|
||||
# import numpy as np
|
||||
#
|
||||
# titles = [
|
||||
# # A组:同品牌同产品,但含义不同
|
||||
# "苹果发布新款iPhone,影像系统再次升级",
|
||||
# "苹果推出全新iPhone,摄像头性能进一步增强",
|
||||
# "苹果回应新款iPhone发热问题:将通过系统更新修复",
|
||||
# "苹果下调部分旧款iPhone售价,新机型并未参与促销",
|
||||
#
|
||||
# # B组:看起来都像“苹果新闻”,但主题已变
|
||||
# "苹果公司股价上涨,市值再创新高",
|
||||
# "苹果供应链承压,部分零部件厂商下调全年预期",
|
||||
# "苹果被曝缩减Vision产品产量,市场需求不及预期",
|
||||
# "苹果发布新款MacBook,并未更新iPhone产品线",
|
||||
#
|
||||
# # C组:同样是“发布/推出”,但主体不同
|
||||
# "华为发布新款手机,影像能力进一步提升",
|
||||
# "小米推出全新手机,影像系统迎来升级",
|
||||
# "OPPO发布年度旗舰机型,主打夜景拍摄",
|
||||
# ]
|
||||
#
|
||||
# print("step 7: start encoding")
|
||||
# t1 = time.time()
|
||||
# embeddings = model.encode(
|
||||
# titles,
|
||||
# normalize_embeddings=True,
|
||||
# show_progress_bar=True,
|
||||
# batch_size=16
|
||||
# )
|
||||
# print(f"step 8: encode done in {time.time() - t1:.2f}s")
|
||||
#
|
||||
# sim = cosine_similarity(embeddings)
|
||||
# print(np.round(sim, 4))
|
||||
#
|
||||
import secrets
|
||||
|
||||
print(secrets.token_urlsafe(64))
|
||||
@@ -1,34 +0,0 @@
|
||||
# Health
|
||||
GET http://127.0.0.1:8000/
|
||||
Accept: application/json
|
||||
|
||||
###
|
||||
# Send register verification code
|
||||
POST http://127.0.0.1:8000/api/v1/auth/register/send-code
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"email": "demo@example.com"
|
||||
}
|
||||
|
||||
###
|
||||
# Register by verification code
|
||||
POST http://127.0.0.1:8000/api/v1/auth/register
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"email": "demo@example.com",
|
||||
"password": "DemoPass123",
|
||||
"verification_code": "123456",
|
||||
"nickname": "demo_user"
|
||||
}
|
||||
|
||||
###
|
||||
# Login
|
||||
POST http://127.0.0.1:8000/api/v1/auth/login
|
||||
Content-Type: application/json
|
||||
|
||||
{
|
||||
"email": "demo@example.com",
|
||||
"password": "DemoPass123"
|
||||
}
|
||||
Reference in New Issue
Block a user