ataberkd commited on
Commit
bae888c
1 Parent(s): 24dbd83

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +9 -4
README.md CHANGED
@@ -8,17 +8,22 @@ pipeline_tag: text-generation
8
  ## 💻 Usage
9
 
10
  ``` python
11
- # pip install transformers accelerate
12
 
13
- from transformers import AutoTokenizer
14
- import transformers
15
  import torch
 
 
 
 
 
 
16
 
17
  model = "ataberkd/llama-2-7b-SQL_FINETUNED_10K"
18
  prompt = 'You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question and give the explanation of result your giving. CREATE TABLE statement: CREATE TABLE "user" ( "name" text, "surname" text, "tel" text, "address" text, "performanceScore" text,"Age" text, "Language" text );. Question: "Can you bring users who speak French and are greater than 20 years old?"'
19
 
20
  tokenizer = AutoTokenizer.from_pretrained(model)
21
- pipeline = transformers.pipeline(
22
  "text-generation",
23
  model=model,
24
  torch_dtype=torch.float16,
 
8
  ## 💻 Usage
9
 
10
  ``` python
11
+ !pip install -q accelerate==0.21.0 transformers==4.31.0
12
 
13
+ import os
 
14
  import torch
15
+ from transformers import (
16
+ AutoModelForCausalLM,
17
+ AutoTokenizer,
18
+ pipeline,
19
+ logging,
20
+ )
21
 
22
  model = "ataberkd/llama-2-7b-SQL_FINETUNED_10K"
23
  prompt = 'You are an expert in SQL and data analysis. Given the table structure described by the CREATE TABLE statement, write an SQL query that provides the solution to the question and give the explanation of result your giving. CREATE TABLE statement: CREATE TABLE "user" ( "name" text, "surname" text, "tel" text, "address" text, "performanceScore" text,"Age" text, "Language" text );. Question: "Can you bring users who speak French and are greater than 20 years old?"'
24
 
25
  tokenizer = AutoTokenizer.from_pretrained(model)
26
+ pipeline = pipeline(
27
  "text-generation",
28
  model=model,
29
  torch_dtype=torch.float16,