stashed changes
Browse files- .gradio/certificate.pem +31 -0
- pipelines.py +44 -0
- training.py +13 -0
.gradio/certificate.pem
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
-----BEGIN CERTIFICATE-----
|
2 |
+
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
|
3 |
+
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
|
4 |
+
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
|
5 |
+
WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
|
6 |
+
ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
|
7 |
+
MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc
|
8 |
+
h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+
|
9 |
+
0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U
|
10 |
+
A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW
|
11 |
+
T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH
|
12 |
+
B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC
|
13 |
+
B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0/1lvh+wjChP4kqKOJ2qxq
|
28 |
+
4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
|
29 |
+
mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
|
30 |
+
emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
|
31 |
+
-----END CERTIFICATE-----
|
pipelines.py
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# from transformers import DistilBertTokenizer, DistilBertForSequenceClassification
|
2 |
+
# import torch
|
3 |
+
# tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
|
4 |
+
# model = DistilBertForSequenceClassification.from_pretrained("distilbert-base-uncased-finetuned-sst-2-english")
|
5 |
+
# inputs = tokenizer("Hello, my dog is sad", return_tensors="pt")
|
6 |
+
|
7 |
+
|
8 |
+
# inputs = tokenizer("Hello, my dog is sad", return_tensors="pt")
|
9 |
+
# with torch.no_grad():
|
10 |
+
# logits = model(**inputs).logits
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
# predicted_class_id = logits.argmax().item()
|
15 |
+
|
16 |
+
# model.config.id2label[predicted_class_id]
|
17 |
+
|
18 |
+
|
19 |
+
# outputs = model(**inputs)
|
20 |
+
|
21 |
+
# print(predicted_class_id)
|
22 |
+
|
23 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
24 |
+
|
25 |
+
# Load the tokenizer
|
26 |
+
tokenizer = AutoTokenizer.from_pretrained("openai-community/gpt2")
|
27 |
+
tokenizer.pad_token = tokenizer.eos_token
|
28 |
+
# Load the model
|
29 |
+
model = AutoModelForCausalLM.from_pretrained("openai-community/gpt2")
|
30 |
+
|
31 |
+
# Example input prompt
|
32 |
+
input_text = "Ann wants to buy a new car"
|
33 |
+
|
34 |
+
# Tokenize input
|
35 |
+
|
36 |
+
inputs = tokenizer(input_text, return_tensors="pt",padding=True, truncation=True)
|
37 |
+
|
38 |
+
# Generate text
|
39 |
+
outputs = model.generate(inputs.input_ids, max_length=100, num_return_sequences=1, top_k=50, top_p=0.9, temperature=0.7,do_sample=True,eos_token_id=None, attention_mask=inputs.attention_mask)
|
40 |
+
print(model.config)
|
41 |
+
# Decode the generated text
|
42 |
+
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
43 |
+
|
44 |
+
print("Generated Text:\n", generated_text)
|
training.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from huggingface_hub import HfApi
|
2 |
+
|
3 |
+
HfApi().create_repo(repo_id="annetade/cv_fit", repo_type="dataset")
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
# splits = {'train': 'train.csv', 'test': 'test.csv'}
|
13 |
+
# df = pd.read_csv("hf://datasets/cnamuangtoun/resume-job-description-fit/" + splits["train"])
|