server: update process tools and tests

This commit is contained in:
Mathieu Virbel
2023-08-01 20:16:54 +02:00
parent cb198927b0
commit e4f2b785ca
5 changed files with 14 additions and 11 deletions

View File

@@ -48,6 +48,13 @@ $ LLM_URL=http://.../api/v1/generate python -m reflector.app
- Ensure the API server is activated in GPT4all - Ensure the API server is activated in GPT4all
- Run with: `LLM_BACKEND=openai LLM_URL=http://localhost:4891/v1/completions LLM_OPENAI_MODEL="GPT4All Falcon" python -m reflector.app` - Run with: `LLM_BACKEND=openai LLM_URL=http://localhost:4891/v1/completions LLM_OPENAI_MODEL="GPT4All Falcon" python -m reflector.app`
### Using local files
```
poetry run python -m reflector.tools.process path/to/audio.wav
```
# Old documentation # Old documentation
This is the code base for the Reflector demo (formerly called agenda-talk-diff) for the leads : Troy Web Consulting This is the code base for the Reflector demo (formerly called agenda-talk-diff) for the leads : Troy Web Consulting

View File

@@ -29,4 +29,5 @@ app.include_router(rtc_offer_router)
if __name__ == "__main__": if __name__ == "__main__":
import uvicorn import uvicorn
uvicorn.run("reflector.app:app", host="0.0.0.0", port=1250, reload=True) uvicorn.run("reflector.app:app", host="0.0.0.0", port=1250, reload=True)

View File

@@ -7,7 +7,7 @@ from reflector.processors import (
AudioTranscriptAutoProcessor, AudioTranscriptAutoProcessor,
TranscriptLinerProcessor, TranscriptLinerProcessor,
TranscriptTopicDetectorProcessor, TranscriptTopicDetectorProcessor,
# TranscriptSummarizerProcessor, TranscriptFinalSummaryProcessor,
) )
import asyncio import asyncio
@@ -29,9 +29,7 @@ async def process_audio_file(filename, event_callback):
AudioTranscriptAutoProcessor.as_threaded(), AudioTranscriptAutoProcessor.as_threaded(),
TranscriptLinerProcessor(callback=on_transcript), TranscriptLinerProcessor(callback=on_transcript),
TranscriptTopicDetectorProcessor.as_threaded(callback=on_topic), TranscriptTopicDetectorProcessor.as_threaded(callback=on_topic),
# TranscriptSummarizerProcessor.as_threaded( TranscriptFinalSummaryProcessor.as_threaded(callback=on_summary),
# callback=on_summary
# ),
) )
pipeline.describe() pipeline.describe()

View File

@@ -2,10 +2,7 @@ import asyncio
from fastapi import Request, APIRouter from fastapi import Request, APIRouter
from reflector.events import subscribers_shutdown from reflector.events import subscribers_shutdown
from pydantic import BaseModel from pydantic import BaseModel
from reflector.models import ( from reflector.models import TranscriptionContext
TranscriptionContext,
TranscriptionOutput,
)
from reflector.logger import logger from reflector.logger import logger
from aiortc import RTCPeerConnection, RTCSessionDescription, MediaStreamTrack from aiortc import RTCPeerConnection, RTCSessionDescription, MediaStreamTrack
from json import loads, dumps from json import loads, dumps

View File

@@ -26,7 +26,7 @@ async def test_basic_process(event_loop):
marks = { marks = {
"transcript": 0, "transcript": 0,
"topic": 0, "topic": 0,
# "summary": 0, "summary": 0,
} }
async def event_callback(event, data): async def event_callback(event, data):
@@ -40,5 +40,5 @@ async def test_basic_process(event_loop):
# validate the events # validate the events
assert marks["transcript"] == 5 assert marks["transcript"] == 5
assert marks["topic"] == 4 assert marks["topic"] == 2
# assert marks["summary"] == 1 assert marks["summary"] == 1