Spaces:
TeamTonic
/

Tonic commited on
Commit
99c11c8
1 Parent(s): 9bc49ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -6,16 +6,16 @@ import torch
6
  import gradio as gr
7
  import sentencepiece
8
 
9
- title = "Welcome to Tonic's 🐋🐳Orca-2-13B (in 8bit)!"
10
- description = "You can use [🐋🐳microsoft/Orca-2-13b](https://huggingface.co/microsoft/Orca-2-13b) via API using Gradio by scrolling down and clicking Use 'Via API' or privately by [cloning this space on huggingface](https://huggingface.co/spaces/Tonic1/TonicsOrca2?duplicate=true) . [Join my active builders' server on discord](https://discord.gg/VqTxc76K3u). Let's build together! Big thanks to the HuggingFace Organisation for the Community Grant."
11
 
12
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
13
- model_name = "microsoft/Orca-2-13b"
14
  tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
15
- model = transformers.AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", load_in_8bit=True)
16
 
17
- class OrcaChatBot:
18
- def __init__(self, model, tokenizer, system_message="You are Orca, an AI language model created by Microsoft. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior."):
19
  self.model = model
20
  self.tokenizer = tokenizer
21
  self.system_message = system_message
 
6
  import gradio as gr
7
  import sentencepiece
8
 
9
+ title = "Welcome to 🙋🏻‍♂️Tonic's😈Xgen-8K Chat!"
10
+ description = "Interestingly there simply wasnt a public demo for Xgen, So I made one. You can use [Salesforce/xgen-7b-8k-inst](https://huggingface.co/Salesforce/xgen-7b-8k-inst) via API using Gradio by scrolling down and clicking Use 'Via API' or privately by [cloning this space on huggingface](https://huggingface.co/spaces/Tonic1/Xgen?duplicate=true) . [Join my active builders' server on discord](https://discord.gg/VqTxc76K3u). Let's build together!."
11
 
12
  device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
13
+ model_name = "Salesforce/xgen-7b-8k-base"
14
  tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=False)
15
+ model = AutoModelForCausalLM.from_pretrained(model_name, dtype=torch.bfloat16, device_map="auto")
16
 
17
+ class XgenChatBot:
18
+ def __init__(self, model, tokenizer, system_message="You are Xgen, an AI language model created by Tonic-AI. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior."):
19
  self.model = model
20
  self.tokenizer = tokenizer
21
  self.system_message = system_message