Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- app.py +4 -4
- config.json +11 -11
app.py
CHANGED
@@ -11,7 +11,7 @@ from transformers import LlamaTokenizer, LlamaForCausalLM, GenerationConfig
|
|
11 |
tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
|
12 |
|
13 |
BASE_MODEL = "TheBloke/vicuna-7B-1.1-HF"
|
14 |
-
LORA_WEIGHTS = "RinInori/vicuna_finetuned_6_sentiments" #Fine-tuned
|
15 |
|
16 |
if torch.cuda.is_available():
|
17 |
device = "cuda"
|
@@ -114,9 +114,9 @@ g = gr.Interface(
|
|
114 |
fn=evaluate,
|
115 |
inputs=[
|
116 |
gr.components.Textbox(
|
117 |
-
lines=2, label="Instruction", placeholder="
|
118 |
),
|
119 |
-
gr.components.Textbox(lines=2, label="Input", placeholder="
|
120 |
gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
|
121 |
gr.components.Slider(minimum=0, maximum=1, value=0.7, label="Top p"),
|
122 |
gr.components.Slider(minimum=0, maximum=100, step=1, value=40, label="Top k"),
|
@@ -134,7 +134,7 @@ g = gr.Interface(
|
|
134 |
title="Fine-tuned version of Vicuna Model",
|
135 |
description="This model is a fine-tuned version of the Vicuna model for sentiment analysis. https://github.com/hennypurwadi/Vicuna_finetune_sentiment_analysis \
|
136 |
Base model is https://huggingface.co/TheBloke/vicuna-7B-1.1-HF \
|
137 |
-
It is fine-tuned and trained on a dataset to
|
138 |
The model was trained and tested on a labeled dataset from Kaggle (https://www.kaggle.com/datasets/praveengovi/emotions-dataset-for-nlp)",
|
139 |
)
|
140 |
|
|
|
11 |
tokenizer = LlamaTokenizer.from_pretrained("decapoda-research/llama-7b-hf")
|
12 |
|
13 |
BASE_MODEL = "TheBloke/vicuna-7B-1.1-HF"
|
14 |
+
LORA_WEIGHTS = "RinInori/vicuna_finetuned_6_sentiments" #Fine-tuned Alpaca model for sentiment analysis
|
15 |
|
16 |
if torch.cuda.is_available():
|
17 |
device = "cuda"
|
|
|
114 |
fn=evaluate,
|
115 |
inputs=[
|
116 |
gr.components.Textbox(
|
117 |
+
lines=2, label="Instruction", placeholder="Type your Instruction here"
|
118 |
),
|
119 |
+
gr.components.Textbox(lines=2, label="Input", placeholder="none"),
|
120 |
gr.components.Slider(minimum=0, maximum=1, value=0.1, label="Temperature"),
|
121 |
gr.components.Slider(minimum=0, maximum=1, value=0.7, label="Top p"),
|
122 |
gr.components.Slider(minimum=0, maximum=100, step=1, value=40, label="Top k"),
|
|
|
134 |
title="Fine-tuned version of Vicuna Model",
|
135 |
description="This model is a fine-tuned version of the Vicuna model for sentiment analysis. https://github.com/hennypurwadi/Vicuna_finetune_sentiment_analysis \
|
136 |
Base model is https://huggingface.co/TheBloke/vicuna-7B-1.1-HF \
|
137 |
+
It is fine-tuned and trained on a dataset to classify text as one of these six different emotions: anger, fear, joy, love, sadness, or surprise. \
|
138 |
The model was trained and tested on a labeled dataset from Kaggle (https://www.kaggle.com/datasets/praveengovi/emotions-dataset-for-nlp)",
|
139 |
)
|
140 |
|
config.json
CHANGED
@@ -1,24 +1,24 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "/
|
3 |
"architectures": [
|
4 |
"LlamaForCausalLM"
|
5 |
],
|
6 |
-
"bos_token_id":
|
7 |
-
"eos_token_id":
|
8 |
"hidden_act": "silu",
|
9 |
-
"hidden_size":
|
10 |
"initializer_range": 0.02,
|
11 |
-
"intermediate_size":
|
12 |
"max_position_embeddings": 2048,
|
13 |
"max_sequence_length": 2048,
|
14 |
"model_type": "llama",
|
15 |
-
"num_attention_heads":
|
16 |
-
"num_hidden_layers":
|
17 |
-
"pad_token_id":
|
18 |
"rms_norm_eps": 1e-06,
|
19 |
"tie_word_embeddings": false,
|
20 |
"torch_dtype": "float16",
|
21 |
-
"transformers_version": "4.28.
|
22 |
"use_cache": true,
|
23 |
-
"vocab_size":
|
24 |
-
}
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "/workspace/huggyllama_llama-13b",
|
3 |
"architectures": [
|
4 |
"LlamaForCausalLM"
|
5 |
],
|
6 |
+
"bos_token_id": 1,
|
7 |
+
"eos_token_id": 2,
|
8 |
"hidden_act": "silu",
|
9 |
+
"hidden_size": 5120,
|
10 |
"initializer_range": 0.02,
|
11 |
+
"intermediate_size": 13824,
|
12 |
"max_position_embeddings": 2048,
|
13 |
"max_sequence_length": 2048,
|
14 |
"model_type": "llama",
|
15 |
+
"num_attention_heads": 40,
|
16 |
+
"num_hidden_layers": 40,
|
17 |
+
"pad_token_id": 0,
|
18 |
"rms_norm_eps": 1e-06,
|
19 |
"tie_word_embeddings": false,
|
20 |
"torch_dtype": "float16",
|
21 |
+
"transformers_version": "4.28.1",
|
22 |
"use_cache": true,
|
23 |
+
"vocab_size": 32001
|
24 |
+
}
|