Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -6,7 +6,7 @@ import uvicorn
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
-
client = InferenceClient("
|
| 10 |
|
| 11 |
class Item(BaseModel):
|
| 12 |
prompt: str
|
|
@@ -41,8 +41,11 @@ def generate(item: Item):
|
|
| 41 |
seed=42,
|
| 42 |
)
|
| 43 |
|
| 44 |
-
formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}", item.history)
|
| 45 |
-
|
|
|
|
|
|
|
|
|
|
| 46 |
output = ""
|
| 47 |
|
| 48 |
for response in stream:
|
|
|
|
| 6 |
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
+
client = InferenceClient("FacebookAI/roberta-large-mnli")
|
| 10 |
|
| 11 |
class Item(BaseModel):
|
| 12 |
prompt: str
|
|
|
|
| 41 |
seed=42,
|
| 42 |
)
|
| 43 |
|
| 44 |
+
#formatted_prompt = format_prompt(f"{item.system_prompt}, {item.prompt}", item.history)
|
| 45 |
+
text = item.prompt
|
| 46 |
+
labels = ["Requirement", "Information"]
|
| 47 |
+
client.zero_shot_classification(text, labels)
|
| 48 |
+
#stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
| 49 |
output = ""
|
| 50 |
|
| 51 |
for response in stream:
|