vprashant commited on
Commit
797e76b
1 Parent(s): 6b42843

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +8 -9
README.md CHANGED
@@ -26,18 +26,17 @@ To generate a Cypher query using this model, you can provide a natural language
26
  from transformers import T5Tokenizer, T5ForConditionalGeneration
27
 
28
  # Load pre-trained model and tokenizer
29
- model_name = 'your-model-name-here'
30
  tokenizer = T5Tokenizer.from_pretrained(model_name)
31
  model = T5ForConditionalGeneration.from_pretrained(model_name)
32
 
33
- # Define input
34
- input_text = "Which employees joined the company after 2015?"
35
-
36
- # Tokenize input
37
- inputs = tokenizer.encode(input_text, return_tensors='pt')
38
 
39
  # Generate Cypher query
40
- outputs = model.generate(inputs)
41
- cypher_query = tokenizer.decode(outputs[0], skip_special_tokens=True)
 
 
42
 
43
- print("Generated Cypher Query:", cypher_query)
 
26
  from transformers import T5Tokenizer, T5ForConditionalGeneration
27
 
28
  # Load pre-trained model and tokenizer
29
+ model_name = 'VPrashant/cypher-gen'
30
  tokenizer = T5Tokenizer.from_pretrained(model_name)
31
  model = T5ForConditionalGeneration.from_pretrained(model_name)
32
 
33
+ # Example input for testing
34
+ test_input = "Which employees joined the company after 2015?"
35
+ test_encoding = tokenizer(test_input, return_tensors="pt", max_length=128, truncation=True, padding="max_length")
 
 
36
 
37
  # Generate Cypher query
38
+ output = model.generate(input_ids=test_encoding['input_ids'], max_length=128)
39
+ generated_query = tokenizer.decode(output[0], skip_special_tokens=True)
40
+
41
+ print("Generated Cypher Query:", generated_query)
42