Spaces:
Runtime error
Runtime error
Commit History
-
Update app.py
a29fa9c
-
Update app.py
e8a1ec7
-
Rename testapp.py to app.py
a6f56ce -
Rename app.py to setup.py
f9dbdac -
Rename setup.py to app.py
3a6fbb1 -
Rename app.py to testapp.py
71dcdff
-
Create app.py
7e0280a -
Update requirements.txt
11c7d45 -
Update requirements.txt
6b198d0 -
Create requirements.txt
96a9d58 -
src/chatbots/gptjbot.pyβ
from transformers import GPTJForCausalLM, AutoTokenizer import os import torch device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") class DialoGPT: def __init__( self, model_name: str = "EleutherAI/gpt-j-6B", local_path="./models/gpt-j-6B", ): if not os.path.exists(local_path): GPTJForCausalLM.from_pretrained(model_name).save_pretrained( local_path, revision="float16", torch_dtype=torch.float16, ) AutoTokenizer.from_pretrained(model_name).save_pretrained(local_path) self.model = GPTJForCausalLM.from_pretrained( local_path, revision="float16", torch_dtype=torch.float16, ) self.tokenizer = AutoTokenizer.from_pretrained(local_path) def __call__(self, inputs: str) -> str: input_ids = self.tokenizer(inputs, return_tensors="pt").input_ids.to(device) generated_ids = seβ¦13a8ecd -
Create src/chatbots/blenderbot.py
c5529b3 -
Create setup.py
e3e058f -
initial commit
1b470b0