elucidator8918 commited on
Commit
139bd10
1 Parent(s): a80aab5

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +29 -37
README.md CHANGED
@@ -7,13 +7,13 @@ language:
7
  ---
8
  ## Overview
9
 
10
- This model, elucidator8918/apigen-prototype-0.1, is tailored for API generation, based on the Mistral-7B-Instruct-v0.1-sharded architecture fine-tuned on the LLAMA-2 Instruct 121k Code dataset.
11
 
12
  ## Key Information
13
 
14
  - **Model Name**: Mistral-7B-Instruct-v0.1-sharded
15
  - **Fine-tuned Model Name**: elucidator8918/apigen-prototype-0.1
16
- - **Dataset**: emre/llama-2-instruct-121k-code
17
  - **Language**: English (en)
18
 
19
  ## Model Details
@@ -51,48 +51,40 @@ This model, elucidator8918/apigen-prototype-0.1, is tailored for API generation,
51
  ```python
52
  from transformers import pipeline
53
 
54
- api_gen_pipeline = pipeline("text-generation", model="elucidator8918/apigen-prototype-0.1")
55
 
56
  # Run text generation pipeline with our next model
57
- prompt = "Write code to do a POST request in FastAPI framework to find the multiplication of two matrices using NumPy"
58
- pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=500)
59
- result = pipe(f"[INST] {prompt} [/INST]")
60
- print(result[0]['generated_text'])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  ```
62
 
63
- - **Output API Generation:**
64
  ```
65
- [INST] Write code to do a POST request in fastapi framework to find the multiplication of two matrices using numpy [/INST]
66
- Below is an example of how to make a POST request in FastAPI to find the multiplication of two matrices using numpy:
67
- ```
68
- ```python
69
- from fastapi import FastAPI, HTTPException
70
- import numpy as np
71
-
72
- app = FastAPI()
73
-
74
- @app.post("/matrix_multiplication")
75
- async def matrix_multiplication(matrix1: np.ndarray, matrix2: np.ndarray):
76
- if matrix1.shape[1]!= matrix2.shape[0]:
77
- raise HTTPException(status_code=400, detail="The number of columns in matrix1 must be equal to the number of rows in matrix2")
78
- result = np.matmul(matrix1, matrix2)
79
- return {"result": result}
80
- ```
81
- This code defines a FastAPI endpoint at `/matrix_multiplication` that takes two matrices as input and returns the multiplication of the two matrices. The `np.matmul` function is used to perform the multiplication. The endpoint also includes a check to ensure that the number of columns in the first matrix is equal to the number of rows in the second matrix.
82
 
83
- To use this endpoint, you can make a POST request to `http://localhost:8000/matrix_multiplication` with the two matrices as input. The response will include the multiplication of the two matrices.
84
- ```python
85
- import requests
86
-
87
- matrix1 = np.array([[1, 2], [3, 4]])
88
- matrix2 = np.array([[5, 6], [7, 8]])
89
-
90
- response = requests.post("http://localhost:8000/matrix_multiplication", json={"matrix1": matrix1, "matrix2": matrix2})
91
-
92
- print(response.json())
93
  ```
94
- This code makes a POST request to the endpoint with the two matrices as input and prints the response. The response should include the multiplication of the two matrices, which is `[[11, 14], [29, 36]]`.
95
-
96
  ## License
97
 
98
  This model is released under the MIT License.
 
7
  ---
8
  ## Overview
9
 
10
+ This model, elucidator8918/clinical-ehr-prototype-0.1, is tailored for clinical documentation, based on the Mistral-7B-Instruct-v0.1-sharded architecture fine-tuned on the Asclepius-Synthetic-Clinical-Notes dataset.
11
 
12
  ## Key Information
13
 
14
  - **Model Name**: Mistral-7B-Instruct-v0.1-sharded
15
  - **Fine-tuned Model Name**: elucidator8918/apigen-prototype-0.1
16
+ - **Dataset**: starmpcc/Asclepius-Synthetic-Clinical-Notes
17
  - **Language**: English (en)
18
 
19
  ## Model Details
 
51
  ```python
52
  from transformers import pipeline
53
 
54
+ pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer)
55
 
56
  # Run text generation pipeline with our next model
57
+ prompt = """
58
+ You are an intelligent clinical languge model.
59
+ Below is a snippet of patient's electronic health record note and a following instruction with question from healthcare professional.
60
+ Write a response that appropriately completes the instruction.
61
+ The response should provide the accurate answer to the instruction, while being concise.
62
+
63
+ ### Instruction:
64
+ Abbreviation Expansion
65
+
66
+ ### Patient's Electronic Health Record Note:
67
+ Hospital Course:
68
+
69
+ This 66-year-old male patient was admitted due to an ischemic left-hemispheric stroke in addition to a dry cough and fever. The patient tested positive for SARS-CoV-2 and experienced severe ARDS, resulting in intubation and ICU admission. The patient underwent veno-venous extracorporeal membrane oxygenation and physical therapy was initiated to focus on perception training, movement exercises, airway-clearing techniques, dysphagia therapy, and mobilization. Despite a trial of sedation cessation, the patient remained somnolent and unable to communicate or follow commands. A side-edge positioning was initiated in combination with intensive exercise training including trunk and head control. Muscle tone and strength remained severely reduced, particularly on his hemiplegic side, and a second SOEB trial failed. Occupational therapy was involved to support functional initiation of upper limb movements and to integrate perception-training into activities of daily living. Currently, the patient remains functionally dependent, tolerates spontaneous breathing trials, and is alert during therapy, although he cannot communicate. He is considered stable and functionally dependent (CPAx 6/50).
70
+
71
+ ### Question:
72
+ What are the abbreviated terms in the given discharge summary that require expansion?
73
+ """
74
+ result = pipe(f"[INST] {prompt} [/INST]",max_length=584)[0]['generated_text']
75
+ start_index = result.find("[/INST]") + len("[/INST]")
76
+ end_index = result.find("'", start_index)
77
+ response = result[start_index:end_index]
78
+ print(response)
79
  ```
80
 
81
+ - **Output Generation:**
82
  ```
83
+ The abbreviated terms in the given discharge summary that requires expansion are SARS-CoV-2, ARDS, ICU, SOEB, CPAx, and CPAx 6/50.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
+ ### Response:
86
+ The abbreviated terms in the given discharge summary that requires expansion are SARS-CoV-2, ARDS, ICU, SOEB, CPAx, and CPAx 6/50. SARS-CoV-2 stands for severe acute respiratory syndrome coronavirus 2, ARDS stands for acute respiratory distress syndrome, ICU stands for intensive care unit, SOEB stands for spontaneous breathing exercise, CPAx stands for Canadian Physical Activity Assessment, and CPAx 6/50 stands for a score of 6 out of 50 on the Canadian Physical Activity Assessment
 
 
 
 
 
 
 
 
87
  ```
 
 
88
  ## License
89
 
90
  This model is released under the MIT License.