Spaces:
Build error
Build error
Commit
•
3a579df
1
Parent(s):
203d6b2
Update app.py
Browse files
app.py
CHANGED
@@ -42,16 +42,6 @@ def query(payload):
|
|
42 |
print(response)
|
43 |
return json.loads(response.content.decode("utf-8"))
|
44 |
|
45 |
-
# https://github.com/NielsRogge/Transformers-Tutorials/blob/master/HuggingFace_vision_ecosystem_overview_(June_2022).ipynb
|
46 |
-
# option 1: load with randomly initialized weights (train from scratch)
|
47 |
-
|
48 |
-
#tokenizer = AutoTokenizer.from_pretrained("EleutherAI/gpt-j-6B")
|
49 |
-
#model = AutoModelForCausalLM.from_pretrained("EleutherAI/gpt-j-6B")
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
|
56 |
|
57 |
def inference(input_sentence, max_length, sample_or_greedy, seed=42):
|
@@ -84,8 +74,7 @@ def inference(input_sentence, max_length, sample_or_greedy, seed=42):
|
|
84 |
|
85 |
generation = data[0]["generated_text"].split(input_sentence, 1)[1]
|
86 |
return (
|
87 |
-
|
88 |
-
+ input_sentence
|
89 |
+ prompt_to_generation
|
90 |
+ generation
|
91 |
+ after_generation,
|
|
|
42 |
print(response)
|
43 |
return json.loads(response.content.decode("utf-8"))
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
|
46 |
|
47 |
def inference(input_sentence, max_length, sample_or_greedy, seed=42):
|
|
|
74 |
|
75 |
generation = data[0]["generated_text"].split(input_sentence, 1)[1]
|
76 |
return (
|
77 |
+
input_sentence
|
|
|
78 |
+ prompt_to_generation
|
79 |
+ generation
|
80 |
+ after_generation,
|