Commit
·
e92d4e6
1
Parent(s):
fb16342
Create mode_card.yaml
Browse files- mode_card.yaml +72 -0
mode_card.yaml
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
model-index:
|
| 2 |
+
- name: LLAMA 7B Sentiment Analysis Adapter
|
| 3 |
+
results:
|
| 4 |
+
- task:
|
| 5 |
+
name: Sentiment Analysis
|
| 6 |
+
type: text-classification
|
| 7 |
+
dataset:
|
| 8 |
+
name: Amazon Sentiment Review dataset
|
| 9 |
+
type: amazon_reviews
|
| 10 |
+
model-metadata:
|
| 11 |
+
license: apache-2.0
|
| 12 |
+
library_name: transformers
|
| 13 |
+
tags: ["text-classification", "sentiment-analysis", "English"]
|
| 14 |
+
languages: ["en"]
|
| 15 |
+
widget:
|
| 16 |
+
- text: "I love using FuturixAI for my daily tasks!"
|
| 17 |
+
|
| 18 |
+
intended-use:
|
| 19 |
+
primary-uses:
|
| 20 |
+
- This model is intended for sentiment analysis on English language text.
|
| 21 |
+
primary-users:
|
| 22 |
+
- Researchers
|
| 23 |
+
- Social media monitoring tools
|
| 24 |
+
- Customer feedback analysis systems
|
| 25 |
+
|
| 26 |
+
training-data:
|
| 27 |
+
training-data-source: Amazon Sentiment Review dataset
|
| 28 |
+
|
| 29 |
+
quantitative-analyses:
|
| 30 |
+
use-cases-limitations:
|
| 31 |
+
- The model may perform poorly on texts that contain a lot of slang or are in a different language than it was trained on.
|
| 32 |
+
|
| 33 |
+
ethical-considerations:
|
| 34 |
+
risks-and-mitigations:
|
| 35 |
+
- There is a risk of the model reinforcing or creating biases based on the training data. Users should be aware of this and consider additional bias mitigation strategies when using the model.
|
| 36 |
+
|
| 37 |
+
model-architecture:
|
| 38 |
+
architecture: LLAMA 7B with LORA adaptation
|
| 39 |
+
library: PeftModel
|
| 40 |
+
|
| 41 |
+
how-to-use:
|
| 42 |
+
installation:
|
| 43 |
+
- pip install transformers peft
|
| 44 |
+
code-examples:
|
| 45 |
+
- |
|
| 46 |
+
```python
|
| 47 |
+
import transformers
|
| 48 |
+
from peft import PeftModel
|
| 49 |
+
|
| 50 |
+
model_name = "meta-llama/Llama-2-7b" # you can use VICUNA 7B model as well
|
| 51 |
+
peft_model_id = "Futurix-AI/LLAMA_7B_Sentiment_Analysis_Amazon_Review_Dataset"
|
| 52 |
+
|
| 53 |
+
tokenizer_t5 = transformers.AutoTokenizer.from_pretrained(model_name)
|
| 54 |
+
model_t5 = transformers.AutoModelForCausalLM.from_pretrained(model_name)
|
| 55 |
+
model_t5 = PeftModel.from_pretrained(model_t5, peft_model_id)
|
| 56 |
+
|
| 57 |
+
prompt = """
|
| 58 |
+
Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
|
| 59 |
+
###Instruction:
|
| 60 |
+
Detect the sentiment of the tweet.
|
| 61 |
+
###Input:
|
| 62 |
+
FuturixAI embodies the spirit of innovation, with a resolve to push the boundaries of what's possible through science and technology.
|
| 63 |
+
###Response:
|
| 64 |
+
"""
|
| 65 |
+
|
| 66 |
+
inputs = tokenizer_t5(prompt, return_tensors="pt")
|
| 67 |
+
for k, v in inputs.items():
|
| 68 |
+
inputs[k] = v
|
| 69 |
+
outputs = model_t5.generate(**inputs, max_length=256, do_sample=True)
|
| 70 |
+
text = tokenizer_t5.batch_decode(outputs, skip_special_tokens=True)[0]
|
| 71 |
+
print(text)
|
| 72 |
+
```
|