Text Generation
Transformers
Safetensors
Chinese
qwen2
autism
assistant
chinese
unsloth
merged-model
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use bysq/autism-assistant-qwen2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bysq/autism-assistant-qwen2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bysq/autism-assistant-qwen2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bysq/autism-assistant-qwen2") model = AutoModelForCausalLM.from_pretrained("bysq/autism-assistant-qwen2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use bysq/autism-assistant-qwen2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bysq/autism-assistant-qwen2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bysq/autism-assistant-qwen2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bysq/autism-assistant-qwen2
- SGLang
How to use bysq/autism-assistant-qwen2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "bysq/autism-assistant-qwen2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bysq/autism-assistant-qwen2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "bysq/autism-assistant-qwen2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bysq/autism-assistant-qwen2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Studio new
How to use bysq/autism-assistant-qwen2 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for bysq/autism-assistant-qwen2 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for bysq/autism-assistant-qwen2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for bysq/autism-assistant-qwen2 to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="bysq/autism-assistant-qwen2", max_seq_length=2048, ) - Docker Model Runner
How to use bysq/autism-assistant-qwen2 with Docker Model Runner:
docker model run hf.co/bysq/autism-assistant-qwen2
自闭症语言理解助手 (Autism Language Assistant) - 完整版
这是一个专门帮助自闭症儿童理解语言的AI助手,基于Qwen2.5-1.5B模型微调而成。此版本为完整合并模型,无需额外的LoRA权重。
模型特点
- ✅ 完整模型:已将LoRA权重合并到基础模型中
- ✅ 即开即用:无需额外配置或权重文件
- ✅ 专业设计:专门为自闭症语言理解场景优化
功能
该模型能够:
- 分析语言中的情感和意图
- 用简单清晰的语言解释复杂表达
- 提供具体的回应建议
- 理解自闭症患者的表达方式
使用方法
先安装其他库
!pip install bitsandbytes accelerate
!pip install transformers torch
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# 加载模型和tokenizer
tokenizer = AutoTokenizer.from_pretrained("bysq/autism-assistant-qwen2")
model = AutoModelForCausalLM.from_pretrained("bysq/autism-assistant-qwen2")
# 移动到GPU(如果可用)
device = "cuda" if torch.cuda.is_available() else "cpu"
model = model.to(device)
# 使用示例
def analyze_expression(original_text, autism_expression):
prompt = f'''你是一个专门帮助理解自闭症患者表达的AI助手。
原始表达:"{original_text}"
自闭症患者的表达:"{autism_expression}"
请分析并回答:
- 情感分析:'''
inputs = tokenizer(prompt, return_tensors="pt").to(device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=200,
do_sample=True,
temperature=0.7,
pad_token_id=tokenizer.pad_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
return response[len(prompt):].strip()
# 测试
result = analyze_expression("可以把东西给我?", "不你")
print(result)
许可证
Apache 2.0
免责声明
该模型仅供辅助使用,不能替代专业医疗建议。建议在专业指导下使用。
- Downloads last month
- 5