Spaces:
				
			
			
	
			
			
		Running
		
			on 
			
			Zero
	
	
	
			
			
	
	
	
	
		
		
		Running
		
			on 
			
			Zero
	Commit 
							
							·
						
						491e00d
	
1
								Parent(s):
							
							fda3501
								
upgraded highlighting, added bitnet
Browse files- utils/arena_df.csv +0 -0
- utils/models.py +1 -0
- utils/prompts.py +19 -20
- utils/vote_logger.py +3 -1
    	
        utils/arena_df.csv
    CHANGED
    
    | The diff for this file is too large to render. 
		See raw diff | 
|  | 
    	
        utils/models.py
    CHANGED
    
    | @@ -18,6 +18,7 @@ models = { | |
| 18 | 
             
                "Phi-4-mini-instruct": "microsoft/phi-4-mini-instruct",
         | 
| 19 | 
             
                #"Cogito-v1-preview-llama-3b": "deepcogito/cogito-v1-preview-llama-3b",
         | 
| 20 | 
             
                "IBM Granite-3.3-2b-instruct": "ibm-granite/granite-3.3-2b-instruct",
         | 
|  | |
| 21 |  | 
| 22 | 
             
            }
         | 
| 23 |  | 
|  | |
| 18 | 
             
                "Phi-4-mini-instruct": "microsoft/phi-4-mini-instruct",
         | 
| 19 | 
             
                #"Cogito-v1-preview-llama-3b": "deepcogito/cogito-v1-preview-llama-3b",
         | 
| 20 | 
             
                "IBM Granite-3.3-2b-instruct": "ibm-granite/granite-3.3-2b-instruct",
         | 
| 21 | 
            +
                "Bitnet-b1.58-2B4T": "microsoft/bitnet-b1.58-2B-4T"
         | 
| 22 |  | 
| 23 | 
             
            }
         | 
| 24 |  | 
    	
        utils/prompts.py
    CHANGED
    
    | @@ -1,34 +1,33 @@ | |
| 1 | 
             
            def format_rag_prompt( query: str, context: str, accepts_sys: bool) -> str:
         | 
| 2 | 
             
                system_prompt = """
         | 
| 3 | 
            -
             | 
| 4 |  | 
| 5 | 
            -
             | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
                The output should not contain your judgment on answerability, only your answer OR your refusal + clarifications.
         | 
| 9 | 
            -
             | 
| 10 | 
            -
                Stay within the bounds of the provided context and avoid making assumptions.
         | 
| 11 |  | 
|  | |
| 12 |  | 
|  | |
| 13 | 
             
                """
         | 
| 14 | 
            -
                user_prompt = f"""
         | 
|  | |
|  | |
|  | |
| 15 |  | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 18 | 
            -
                If so, provide a complete, grounded answer to the query, and do not mention your judgement.
         | 
| 19 | 
            -
                Try to address all aspects of the query, but if certain parts are not answerable, answer what you can and indicate clearly where additional information is needed.
         | 
| 20 |  | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
|  | |
|  | |
| 23 |  | 
| 24 | 
            -
             | 
| 25 | 
            -
                Given the following query and context, please provide your response:
         | 
| 26 | 
            -
                Query: {query}
         | 
| 27 |  | 
| 28 | 
            -
             | 
| 29 |  | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 |  | 
| 33 | 
             
                messages = (
         | 
| 34 | 
             
                    [
         | 
|  | |
| 1 | 
             
            def format_rag_prompt( query: str, context: str, accepts_sys: bool) -> str:
         | 
| 2 | 
             
                system_prompt = """
         | 
| 3 | 
            +
            You are a helpful assistant that provides answers to queries based on the provided context.
         | 
| 4 |  | 
| 5 | 
            +
            If the full, complete answer to the query cannot be found in the context, answer what the context allows you to answer and indicate clearly where additional information is needed.
         | 
| 6 | 
            +
            If the none of the answer can be found, clearly refuse to answer, and ask for more relevant information from the user.
         | 
|  | |
|  | |
|  | |
|  | |
| 7 |  | 
| 8 | 
            +
            The output should not contain your judgment on answerability, only your answer OR your refusal + clarifications.
         | 
| 9 |  | 
| 10 | 
            +
            Stay within the bounds of the provided context and avoid making assumptions.
         | 
| 11 | 
             
                """
         | 
| 12 | 
            +
                user_prompt = f"""# Role and Task Description
         | 
| 13 | 
            +
            Judge if the following query is answerable from ONLY the provided context.
         | 
| 14 | 
            +
            If so, provide a complete, grounded answer to the query, and do not mention your judgement.
         | 
| 15 | 
            +
            Try to address all aspects of the query, but if certain parts are not answerable, answer what you can and indicate clearly where additional information is needed.
         | 
| 16 |  | 
| 17 | 
            +
            If none of the query's answer can be found in the context, clearly refuse to answer, and ask for more relevant information from the user.
         | 
| 18 | 
            +
            You should give a concise explanation of why you cannot answer the query based on the context, and ask for more relevant information from the user.
         | 
|  | |
|  | |
| 19 |  | 
| 20 | 
            +
            # Task
         | 
| 21 | 
            +
            Given the following query and context, please provide your response:
         | 
| 22 | 
            +
            ## Query: 
         | 
| 23 | 
            +
            {query}
         | 
| 24 |  | 
| 25 | 
            +
            ## Context: 
         | 
|  | |
|  | |
| 26 |  | 
| 27 | 
            +
            {context}
         | 
| 28 |  | 
| 29 | 
            +
            WITHOUT mentioning your judgement either your grounded answer, OR refusal and clarifications:
         | 
| 30 | 
            +
            """
         | 
| 31 |  | 
| 32 | 
             
                messages = (
         | 
| 33 | 
             
                    [
         | 
    	
        utils/vote_logger.py
    CHANGED
    
    | @@ -18,7 +18,8 @@ hub_votes = hf_hub_download( | |
| 18 | 
             
                repo_id="aizip-dev/Arena-Metadata",
         | 
| 19 | 
             
                filename="vote_details.csv",
         | 
| 20 | 
             
                repo_type="dataset",
         | 
| 21 | 
            -
                revision="main", | 
|  | |
| 22 |  | 
| 23 | 
             
            df = pd.read_csv(hub_votes)
         | 
| 24 | 
             
            print(f"Successfully loaded leaderboard from the Hub. {len(df)} votes.")
         | 
| @@ -66,6 +67,7 @@ def save_vote_details(example, model_a, model_b, winner, feedback, summary_a, su | |
| 66 |  | 
| 67 | 
             
                            # Write the vote record
         | 
| 68 | 
             
                            writer.writerow(vote_record)
         | 
|  | |
| 69 |  | 
| 70 | 
             
                        print(f"Vote details saved to {csv_path}")
         | 
| 71 | 
             
                except Exception as e:
         | 
|  | |
| 18 | 
             
                repo_id="aizip-dev/Arena-Metadata",
         | 
| 19 | 
             
                filename="vote_details.csv",
         | 
| 20 | 
             
                repo_type="dataset",
         | 
| 21 | 
            +
                revision="main",
         | 
| 22 | 
            +
                )
         | 
| 23 |  | 
| 24 | 
             
            df = pd.read_csv(hub_votes)
         | 
| 25 | 
             
            print(f"Successfully loaded leaderboard from the Hub. {len(df)} votes.")
         | 
|  | |
| 67 |  | 
| 68 | 
             
                            # Write the vote record
         | 
| 69 | 
             
                            writer.writerow(vote_record)
         | 
| 70 | 
            +
                            
         | 
| 71 |  | 
| 72 | 
             
                        print(f"Vote details saved to {csv_path}")
         | 
| 73 | 
             
                except Exception as e:
         | 
 
			

