theoracle commited on
Commit
532db4d
1 Parent(s): e2107d8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +50 -17
README.md CHANGED
@@ -1,29 +1,38 @@
1
  ---
 
2
  tags:
3
  - autotrain
4
- - text-generation-inference
5
  - text-generation
6
  - peft
 
 
7
  library_name: transformers
8
  widget:
9
  - messages:
10
  - role: user
11
- content: What is your favorite condiment?
12
  license: other
13
  ---
14
 
15
- # Model Trained Using AutoTrain
16
 
17
- This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
18
 
19
- # Usage
20
 
21
- ```python
 
 
22
 
23
- from transformers import AutoModelForCausalLM, AutoTokenizer
24
 
25
- model_path = "PATH_TO_THIS_REPO"
26
 
 
 
 
 
27
  tokenizer = AutoTokenizer.from_pretrained(model_path)
28
  model = AutoModelForCausalLM.from_pretrained(
29
  model_path,
@@ -31,15 +40,39 @@ model = AutoModelForCausalLM.from_pretrained(
31
  torch_dtype='auto'
32
  ).eval()
33
 
34
- # Prompt content: "hi"
35
- messages = [
36
- {"role": "user", "content": "hi"}
37
- ]
 
 
 
 
 
38
 
39
- input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
40
- output_ids = model.generate(input_ids.to('cuda'))
41
- response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
 
 
 
 
 
42
 
43
- # Model response: "Hello! How can I assist you today?"
44
  print(response)
45
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Kaggle Q&A Gemma Model
3
  tags:
4
  - autotrain
5
+ - kaggle-qa
6
  - text-generation
7
  - peft
8
+ datasets:
9
+ - custom
10
  library_name: transformers
11
  widget:
12
  - messages:
13
  - role: user
14
+ content: How do I submit to a Kaggle competition?
15
  license: other
16
  ---
17
 
18
+ ## Overview
19
 
20
+ Developed with the cutting-edge AutoTrain and PEFT technologies, this model is specifically trained to provide detailed answers to questions about Kaggle. Whether you're wondering how to get started, how to submit to a competition, or how to navigate the datasets, this model is equipped to assist.
21
 
22
+ ## Key Features
23
 
24
+ - **Kaggle-Specific Knowledge**: Designed to offer insights and guidance on using Kaggle, from competition submissions to data exploration.
25
+ - **Powered by AutoTrain**: Utilizes Hugging Face's AutoTrain for efficient and effective training, ensuring high-quality responses.
26
+ - **PEFT Enhanced**: Benefits from PEFT for improved performance and efficiency, making it highly scalable and robust.
27
 
28
+ ## Usage
29
 
30
+ The following Python code snippet illustrates how to use this model to answer your Kaggle-related questions:
31
 
32
+ ```python
33
+ from transformers import AutoModelForCausalLM, AutoTokenizer
34
+
35
+ model_path = "theoracle/autotrain-kaggle"
36
  tokenizer = AutoTokenizer.from_pretrained(model_path)
37
  model = AutoModelForCausalLM.from_pretrained(
38
  model_path,
 
40
  torch_dtype='auto'
41
  ).eval()
42
 
43
+ tokenizer.pad_token = tokenizer.eos_token
44
+
45
+ prompt = '''
46
+ ### How do I prepare for Kaggle competitions?\n ### Answer:
47
+ '''
48
+
49
+ encoding = tokenizer(prompt, return_tensors='pt', padding=True, truncation=True, max_length=500, add_special_tokens=True)
50
+ input_ids = encoding['input_ids']
51
+ attention_mask = encoding['attention_mask']
52
 
53
+ output_ids = model.generate(
54
+ input_ids.to('cuda'),
55
+ attention_mask=attention_mask.to('cuda'),
56
+ max_new_tokens=300,
57
+ pad_token_id=tokenizer.eos_token_id
58
+ )
59
+
60
+ response = tokenizer.decode(output_ids[0], skip_special_tokens=True)
61
 
 
62
  print(response)
63
+ ```
64
+
65
+ ## Application Scenarios
66
+
67
+ This model is particularly useful for:
68
+ - Kaggle competitors seeking advice on strategy and submissions.
69
+ - Educators and students looking for a tool to facilitate learning through Kaggle competitions.
70
+ - Data scientists requiring quick access to information about Kaggle datasets and competitions.
71
+
72
+ ## About AutoTrain and PEFT
73
+
74
+ AutoTrain by Hugging Face streamlines the model training process, making it easier and more efficient to develop state-of-the-art models. PEFT enhances this by providing a framework for efficient model training and deployment. Together, they enable this model to deliver fast and accurate responses to your Kaggle inquiries.
75
+
76
+ ## License
77
+
78
+ This model is distributed under an "other" license, allowing diverse applications while encouraging users to review the license terms for compliance with their project requirements.