MistralFinance / README.md
pran1805's picture
Update README.md
0183d4e
metadata
tags:
  - autotrain
  - text-generation
widget:
  - text: >-
      Based on its Cashflow Statement from 20-11-18 to 09-12-21, should I invest
      in advanced micro devices?
license: other

Example Image

Usage

from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch

model ="pran1805/MistralFinance"

tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    tokenizer=tokenizer,
    torch_dtype=torch.bfloat16,
    device_map="auto",
)

sequences = pipeline(
   "QUERY",
    max_length=80,
    do_sample=True,
    top_k=10,
    num_return_sequences=1,
    eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
    print(f"Result: {seq['generated_text'].split('Below')[0]}")