Translation
Transformers
PyTorch
Safetensors
Chinese
English
bloom
text-generation
gpt-style
chinese
english
text-generation-inference
Instructions to use nullday/immersiveL-exp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nullday/immersiveL-exp with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # 'pip install "transformers<5.0.0' from transformers import pipeline pipe = pipeline("translation", model="nullday/immersiveL-exp")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nullday/immersiveL-exp") model = AutoModelForCausalLM.from_pretrained("nullday/immersiveL-exp") - Notebooks
- Google Colab
- Kaggle
Hosted inference API 补充
#8
by TimVan1 - opened
主页的Hosted inference API 补充
import requests
from flask import Flask, request, jsonify
app = Flask(__name__)
app.config.from_pyfile('config.py')
PROMPT_DICT = app.config["PROMPT_DICT"]
API_URL = "https://api-inference.huggingface.co/models/funstoryai/immersiveL-exp"
headers = {"Authorization": "Bearer hf_YOUR_TOKEN"}
def query(prompt):
payload = {
"inputs": prompt,
"parameters": {"do_sample": False,
"max_length": 500,
"repetition_penalty": 1.4,
"temperature":0},
}
response = requests.post(API_URL, headers=headers, json=payload)
return response.json()
text="这是一个测试句子"
task = 'zh2en'
prompt = generate_input_prompt(text, task)
output = query(prompt)
TimVan1 changed discussion status to closed